|
@@ -1,169 +1,177 @@
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!-- namespace必须指向DAO接口 -->
|
|
<!-- namespace必须指向DAO接口 -->
|
|
<mapper namespace="com.jpsoft.picc.modules.base.dao.CompanyMemberDAO">
|
|
<mapper namespace="com.jpsoft.picc.modules.base.dao.CompanyMemberDAO">
|
|
- <resultMap id="CompanyMemberMap" type="com.jpsoft.picc.modules.base.entity.CompanyMember">
|
|
|
|
- <id property="id" column="id_" />
|
|
|
|
- <result property="companyId" column="company_id" />
|
|
|
|
- <result property="name" column="name_" />
|
|
|
|
- <result property="cardType" column="card_type" />
|
|
|
|
- <result property="cardNo" column="card_no" />
|
|
|
|
- <result property="sex" column="sex_" />
|
|
|
|
- <result property="age" column="age_" />
|
|
|
|
- <result property="jobsId" column="jobs_id" />
|
|
|
|
- <result property="jobName" column="job_name" />
|
|
|
|
- <result property="healthStatus" column="health_status" />
|
|
|
|
- <result property="cardFiles" column="card_files" />
|
|
|
|
- <result property="status" column="status_" />
|
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
|
- <result property="delFlag" column="del_flag" />
|
|
|
|
- </resultMap>
|
|
|
|
- <insert id="insert" parameterType="com.jpsoft.picc.modules.base.entity.CompanyMember">
|
|
|
|
- <!--
|
|
|
|
- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
|
- select sys_guid() from dual
|
|
|
|
- </selectKey>
|
|
|
|
- -->
|
|
|
|
- <![CDATA[
|
|
|
|
|
|
+ <resultMap id="CompanyMemberMap" type="com.jpsoft.picc.modules.base.entity.CompanyMember">
|
|
|
|
+ <id property="id" column="id_"/>
|
|
|
|
+ <result property="companyId" column="company_id"/>
|
|
|
|
+ <result property="name" column="name_"/>
|
|
|
|
+ <result property="cardType" column="card_type"/>
|
|
|
|
+ <result property="cardNo" column="card_no"/>
|
|
|
|
+ <result property="sex" column="sex_"/>
|
|
|
|
+ <result property="age" column="age_"/>
|
|
|
|
+ <result property="jobsId" column="jobs_id"/>
|
|
|
|
+ <result property="jobName" column="job_name"/>
|
|
|
|
+ <result property="healthStatus" column="health_status"/>
|
|
|
|
+ <result property="cardFiles" column="card_files"/>
|
|
|
|
+ <result property="status" column="status_"/>
|
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
|
+ <association property="cardTypeN"
|
|
|
|
+ column="{catalogName=card_type_catalog,value=card_type}"
|
|
|
|
+ select="com.jpsoft.picc.modules.sys.dao.DataDictionaryDAO.findNameByCatalogNameAndValue"
|
|
|
|
+ />
|
|
|
|
+ </resultMap>
|
|
|
|
+ <insert id="insert" parameterType="com.jpsoft.picc.modules.base.entity.CompanyMember">
|
|
|
|
+ <!--
|
|
|
|
+ <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
|
|
|
|
+ select sys_guid() from dual
|
|
|
|
+ </selectKey>
|
|
|
|
+ -->
|
|
|
|
+ <![CDATA[
|
|
insert into base_company_member
|
|
insert into base_company_member
|
|
(id_,company_id,name_,card_type,card_no,sex_,age_,jobs_id,health_status,card_files,status_,create_by,create_time,update_by,update_time,del_flag)
|
|
(id_,company_id,name_,card_type,card_no,sex_,age_,jobs_id,health_status,card_files,status_,create_by,create_time,update_by,update_time,del_flag)
|
|
values
|
|
values
|
|
(
|
|
(
|
|
-#{id,jdbcType=VARCHAR}
|
|
|
|
-,#{companyId,jdbcType=VARCHAR}
|
|
|
|
-,#{name,jdbcType=VARCHAR}
|
|
|
|
-,#{cardType,jdbcType=VARCHAR}
|
|
|
|
-,#{cardNo,jdbcType=VARCHAR}
|
|
|
|
-,#{sex,jdbcType= NUMERIC }
|
|
|
|
-,#{age,jdbcType= NUMERIC }
|
|
|
|
-,#{jobsId,jdbcType=VARCHAR}
|
|
|
|
-,#{healthStatus,jdbcType=VARCHAR}
|
|
|
|
-,#{cardFiles,jdbcType=VARCHAR}
|
|
|
|
-,#{status,jdbcType=VARCHAR}
|
|
|
|
-,#{createBy,jdbcType=VARCHAR}
|
|
|
|
-,#{createTime,jdbcType= TIMESTAMP }
|
|
|
|
-,#{updateBy,jdbcType=VARCHAR}
|
|
|
|
-,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
|
-,#{delFlag,jdbcType= NUMERIC }
|
|
|
|
|
|
+ #{id,jdbcType=VARCHAR}
|
|
|
|
+ ,#{companyId,jdbcType=VARCHAR}
|
|
|
|
+ ,#{name,jdbcType=VARCHAR}
|
|
|
|
+ ,#{cardType,jdbcType=VARCHAR}
|
|
|
|
+ ,#{cardNo,jdbcType=VARCHAR}
|
|
|
|
+ ,#{sex,jdbcType= NUMERIC }
|
|
|
|
+ ,#{age,jdbcType= NUMERIC }
|
|
|
|
+ ,#{jobsId,jdbcType=VARCHAR}
|
|
|
|
+ ,#{healthStatus,jdbcType=VARCHAR}
|
|
|
|
+ ,#{cardFiles,jdbcType=VARCHAR}
|
|
|
|
+ ,#{status,jdbcType=VARCHAR}
|
|
|
|
+ ,#{createBy,jdbcType=VARCHAR}
|
|
|
|
+ ,#{createTime,jdbcType= TIMESTAMP }
|
|
|
|
+ ,#{updateBy,jdbcType=VARCHAR}
|
|
|
|
+ ,#{updateTime,jdbcType= TIMESTAMP }
|
|
|
|
+ ,#{delFlag,jdbcType= NUMERIC }
|
|
)
|
|
)
|
|
]]>
|
|
]]>
|
|
- </insert>
|
|
|
|
- <delete id="delete" parameterType="string">
|
|
|
|
- delete from base_company_member where id_=#{id,jdbcType=VARCHAR}
|
|
|
|
- </delete>
|
|
|
|
- <update id="update" parameterType="com.jpsoft.picc.modules.base.entity.CompanyMember">
|
|
|
|
- update base_company_member
|
|
|
|
- <set>
|
|
|
|
- <if test="companyId!=null">
|
|
|
|
- company_id=#{companyId,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="name!=null">
|
|
|
|
- name_=#{name,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="cardType!=null">
|
|
|
|
- card_type=#{cardType,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="cardNo!=null">
|
|
|
|
- card_no=#{cardNo,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="sex!=null">
|
|
|
|
- sex_=#{sex,jdbcType= NUMERIC },
|
|
|
|
- </if>
|
|
|
|
- <if test="age!=null">
|
|
|
|
- age_=#{age,jdbcType= NUMERIC },
|
|
|
|
- </if>
|
|
|
|
- <if test="jobsId!=null">
|
|
|
|
- jobs_id=#{jobsId,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="healthStatus!=null">
|
|
|
|
- health_status=#{healthStatus,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="cardFiles!=null">
|
|
|
|
- card_files=#{cardFiles,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="status!=null">
|
|
|
|
- status_=#{status,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="createBy!=null">
|
|
|
|
- create_by=#{createBy,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="createTime!=null">
|
|
|
|
- create_time=#{createTime,jdbcType= TIMESTAMP },
|
|
|
|
- </if>
|
|
|
|
- <if test="updateBy!=null">
|
|
|
|
- update_by=#{updateBy,jdbcType=VARCHAR},
|
|
|
|
- </if>
|
|
|
|
- <if test="updateTime!=null">
|
|
|
|
- update_time=#{updateTime,jdbcType= TIMESTAMP },
|
|
|
|
- </if>
|
|
|
|
- <if test="delFlag!=null">
|
|
|
|
- del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
|
|
- </if>
|
|
|
|
- </set>
|
|
|
|
- where id_=#{id}
|
|
|
|
- </update>
|
|
|
|
- <select id="get" parameterType="string" resultMap="CompanyMemberMap">
|
|
|
|
- select t1.*,t2.name_ as job_name from base_company_member t1 left join base_jobs t2 on t1.jobs_id=t2.id_
|
|
|
|
- where t1.id_=#{0}
|
|
|
|
- </select>
|
|
|
|
- <select id="exist" parameterType="string" resultType="int">
|
|
|
|
- select count(*) from base_company_member t1 where t1.id_=#{0}
|
|
|
|
- </select>
|
|
|
|
- <select id="list" resultMap="CompanyMemberMap">
|
|
|
|
- select t1.*,t2.name_ as job_name from base_company_member t1 left join base_jobs t2 on t1.jobs_id=t2.id_
|
|
|
|
- where t1.del_flag=0
|
|
|
|
- </select>
|
|
|
|
- <select id="search" parameterType="hashmap" resultMap="CompanyMemberMap">
|
|
|
|
- <![CDATA[
|
|
|
|
- select * from (
|
|
|
|
|
|
+ </insert>
|
|
|
|
+ <delete id="delete" parameterType="string">
|
|
|
|
+ delete from base_company_member where id_=#{id,jdbcType=VARCHAR}
|
|
|
|
+ </delete>
|
|
|
|
+ <update id="update" parameterType="com.jpsoft.picc.modules.base.entity.CompanyMember">
|
|
|
|
+ update base_company_member
|
|
|
|
+ <set>
|
|
|
|
+ <if test="companyId!=null">
|
|
|
|
+ company_id=#{companyId,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="name!=null">
|
|
|
|
+ name_=#{name,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="cardType!=null">
|
|
|
|
+ card_type=#{cardType,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="cardNo!=null">
|
|
|
|
+ card_no=#{cardNo,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="sex!=null">
|
|
|
|
+ sex_=#{sex,jdbcType= NUMERIC },
|
|
|
|
+ </if>
|
|
|
|
+ <if test="age!=null">
|
|
|
|
+ age_=#{age,jdbcType= NUMERIC },
|
|
|
|
+ </if>
|
|
|
|
+ <if test="jobsId!=null">
|
|
|
|
+ jobs_id=#{jobsId,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="healthStatus!=null">
|
|
|
|
+ health_status=#{healthStatus,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="cardFiles!=null">
|
|
|
|
+ card_files=#{cardFiles,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="status!=null">
|
|
|
|
+ status_=#{status,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createBy!=null">
|
|
|
|
+ create_by=#{createBy,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime!=null">
|
|
|
|
+ create_time=#{createTime,jdbcType= TIMESTAMP },
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateBy!=null">
|
|
|
|
+ update_by=#{updateBy,jdbcType=VARCHAR},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateTime!=null">
|
|
|
|
+ update_time=#{updateTime,jdbcType= TIMESTAMP },
|
|
|
|
+ </if>
|
|
|
|
+ <if test="delFlag!=null">
|
|
|
|
+ del_flag=#{delFlag,jdbcType= NUMERIC },
|
|
|
|
+ </if>
|
|
|
|
+ </set>
|
|
|
|
+ where id_=#{id}
|
|
|
|
+ </update>
|
|
|
|
+ <select id="get" parameterType="string" resultMap="CompanyMemberMap">
|
|
|
|
+ select t1.*,t2.name_ as job_name,'证件类型' as card_type_catalog
|
|
|
|
+ from
|
|
|
|
+ base_company_member t1 left join base_jobs t2 on t1.jobs_id=t2.id_
|
|
|
|
+ where t1.id_=#{0}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="exist" parameterType="string" resultType="int">
|
|
|
|
+ select count(*) from base_company_member t1 where t1.id_=#{0}
|
|
|
|
+ </select>
|
|
|
|
+ <select id="list" resultMap="CompanyMemberMap">
|
|
|
|
+ select t1.*,t2.name_ as job_name,'证件类型' as card_type_catalog
|
|
|
|
+ from base_company_member t1 left join base_jobs t2 on t1.jobs_id=t2.id_
|
|
|
|
+ where t1.del_flag=0
|
|
|
|
+ </select>
|
|
|
|
+ <select id="search" parameterType="hashmap" resultMap="CompanyMemberMap">
|
|
|
|
+ <![CDATA[
|
|
|
|
+ select t.*,'证件类型' as card_type_catalog from (
|
|
select t1.*,t2.name_ as job_name from base_company_member t1
|
|
select t1.*,t2.name_ as job_name from base_company_member t1
|
|
left join base_jobs t2 on t1.jobs_id=t2.id_
|
|
left join base_jobs t2 on t1.jobs_id=t2.id_
|
|
) as t
|
|
) as t
|
|
]]>
|
|
]]>
|
|
- <where>
|
|
|
|
- <if test="searchParams.id != null">
|
|
|
|
- and ID_ like #{searchParams.id}
|
|
|
|
- </if>
|
|
|
|
- <if test="searchParams.companyId != null">
|
|
|
|
- and company_id = #{searchParams.companyId}
|
|
|
|
- </if>
|
|
|
|
- <if test="searchParams.memberName != null">
|
|
|
|
- and name_ like #{searchParams.memberName}
|
|
|
|
- </if>
|
|
|
|
- <if test="searchParams.jobsId != null">
|
|
|
|
- and jobs_id = #{searchParams.jobsId}
|
|
|
|
- </if>
|
|
|
|
- <if test="searchParams.delFlag != null">
|
|
|
|
- and del_flag = #{searchParams.delFlag}
|
|
|
|
- </if>
|
|
|
|
- <if test="searchParams.cardNo != null">
|
|
|
|
- and card_no = #{searchParams.cardNo}
|
|
|
|
- </if>
|
|
|
|
- <if test="searchParams.excludePolicyId != null">
|
|
|
|
- and id_ not in(
|
|
|
|
- select member_id from business_insurance_policy_member
|
|
|
|
- where policy_id = #{searchParams.excludePolicyId}
|
|
|
|
- and del_flag=0
|
|
|
|
- )
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
- <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
|
- ${sort.name} ${sort.order}
|
|
|
|
- </foreach>
|
|
|
|
- </select>
|
|
|
|
|
|
+ <where>
|
|
|
|
+ <if test="searchParams.id != null">
|
|
|
|
+ and ID_ like #{searchParams.id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchParams.companyId != null">
|
|
|
|
+ and company_id = #{searchParams.companyId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchParams.memberName != null">
|
|
|
|
+ and name_ like #{searchParams.memberName}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchParams.jobsId != null">
|
|
|
|
+ and jobs_id = #{searchParams.jobsId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchParams.delFlag != null">
|
|
|
|
+ and del_flag = #{searchParams.delFlag}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchParams.cardNo != null">
|
|
|
|
+ and card_no = #{searchParams.cardNo}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="searchParams.excludePolicyId != null">
|
|
|
|
+ and id_ not in(
|
|
|
|
+ select member_id from business_insurance_policy_member
|
|
|
|
+ where policy_id = #{searchParams.excludePolicyId}
|
|
|
|
+ and del_flag=0
|
|
|
|
+ )
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ <foreach item="sort" collection="sortList" open="order by" separator=",">
|
|
|
|
+ ${sort.name} ${sort.order}
|
|
|
|
+ </foreach>
|
|
|
|
+ </select>
|
|
<select id="findByNotInPolicyMember" resultMap="CompanyMemberMap">
|
|
<select id="findByNotInPolicyMember" resultMap="CompanyMemberMap">
|
|
- select * from base_company_member t1
|
|
|
|
- where t1.del_flag=0 and t1.company_id=#{companyId}
|
|
|
|
- and t1.id_ not in(
|
|
|
|
- select member_id from business_insurance_policy_member
|
|
|
|
- where del_flag=0
|
|
|
|
- <foreach item="policyId" collection="excludePolicyIds" open=" and policy_id in(" separator="," close=")">
|
|
|
|
- #{policyId}
|
|
|
|
- </foreach>
|
|
|
|
- )
|
|
|
|
- </select>
|
|
|
|
|
|
+ select t1.*,'证件类型' as card_type_catalog
|
|
|
|
+ from base_company_member t1
|
|
|
|
+ where t1.del_flag=0 and t1.company_id=#{companyId}
|
|
|
|
+ and t1.id_ not in(
|
|
|
|
+ select member_id from business_insurance_policy_member
|
|
|
|
+ where del_flag=0
|
|
|
|
+ <foreach item="policyId" collection="excludePolicyIds" open=" and policy_id in(" separator="," close=")">
|
|
|
|
+ #{policyId}
|
|
|
|
+ </foreach>
|
|
|
|
+ )
|
|
|
|
+ </select>
|
|
</mapper>
|
|
</mapper>
|