CompanyMember.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.picc.modules.base.dao.CompanyMemberDAO">
  6. <resultMap id="CompanyMemberMap" type="com.jpsoft.picc.modules.base.entity.CompanyMember">
  7. <id property="id" column="id_" />
  8. <result property="companyId" column="company_id" />
  9. <result property="name" column="name_" />
  10. <result property="cardType" column="card_type" />
  11. <result property="cardNo" column="card_no" />
  12. <result property="sex" column="sex_" />
  13. <result property="age" column="age_" />
  14. <result property="jobsId" column="jobs_id" />
  15. <result property="healthStatus" column="health_status" />
  16. <result property="cardFiles" column="card_files" />
  17. <result property="status" column="status_" />
  18. <result property="createBy" column="create_by" />
  19. <result property="createTime" column="create_time" />
  20. <result property="updateBy" column="update_by" />
  21. <result property="updateTime" column="update_time" />
  22. <result property="delFlag" column="del_flag" />
  23. </resultMap>
  24. <insert id="insert" parameterType="com.jpsoft.picc.modules.base.entity.CompanyMember">
  25. <!--
  26. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  27. select sys_guid() from dual
  28. </selectKey>
  29. -->
  30. <![CDATA[
  31. insert into base_company_member
  32. (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)
  33. values
  34. (
  35. #{id,jdbcType=VARCHAR}
  36. ,#{companyId,jdbcType=VARCHAR}
  37. ,#{name,jdbcType=VARCHAR}
  38. ,#{cardType,jdbcType=VARCHAR}
  39. ,#{cardNo,jdbcType=VARCHAR}
  40. ,#{sex,jdbcType= NUMERIC }
  41. ,#{age,jdbcType= NUMERIC }
  42. ,#{jobsId,jdbcType=VARCHAR}
  43. ,#{healthStatus,jdbcType=VARCHAR}
  44. ,#{cardFiles,jdbcType=VARCHAR}
  45. ,#{status,jdbcType=VARCHAR}
  46. ,#{createBy,jdbcType=VARCHAR}
  47. ,#{createTime,jdbcType= TIMESTAMP }
  48. ,#{updateBy,jdbcType=VARCHAR}
  49. ,#{updateTime,jdbcType= TIMESTAMP }
  50. ,#{delFlag,jdbcType= NUMERIC }
  51. )
  52. ]]>
  53. </insert>
  54. <delete id="delete" parameterType="string">
  55. delete from base_company_member where id_=#{id,jdbcType=VARCHAR}
  56. </delete>
  57. <update id="update" parameterType="com.jpsoft.picc.modules.base.entity.CompanyMember">
  58. update base_company_member
  59. <set>
  60. <if test="companyId!=null">
  61. company_id=#{companyId,jdbcType=VARCHAR},
  62. </if>
  63. <if test="name!=null">
  64. name_=#{name,jdbcType=VARCHAR},
  65. </if>
  66. <if test="cardType!=null">
  67. card_type=#{cardType,jdbcType=VARCHAR},
  68. </if>
  69. <if test="cardNo!=null">
  70. card_no=#{cardNo,jdbcType=VARCHAR},
  71. </if>
  72. <if test="sex!=null">
  73. sex_=#{sex,jdbcType= NUMERIC },
  74. </if>
  75. <if test="age!=null">
  76. age_=#{age,jdbcType= NUMERIC },
  77. </if>
  78. <if test="jobsId!=null">
  79. jobs_id=#{jobsId,jdbcType=VARCHAR},
  80. </if>
  81. <if test="healthStatus!=null">
  82. health_status=#{healthStatus,jdbcType=VARCHAR},
  83. </if>
  84. <if test="cardFiles!=null">
  85. card_files=#{cardFiles,jdbcType=VARCHAR},
  86. </if>
  87. <if test="status!=null">
  88. status_=#{status,jdbcType=VARCHAR},
  89. </if>
  90. <if test="createBy!=null">
  91. create_by=#{createBy,jdbcType=VARCHAR},
  92. </if>
  93. <if test="createTime!=null">
  94. create_time=#{createTime,jdbcType= TIMESTAMP },
  95. </if>
  96. <if test="updateBy!=null">
  97. update_by=#{updateBy,jdbcType=VARCHAR},
  98. </if>
  99. <if test="updateTime!=null">
  100. update_time=#{updateTime,jdbcType= TIMESTAMP },
  101. </if>
  102. <if test="delFlag!=null">
  103. del_flag=#{delFlag,jdbcType= NUMERIC },
  104. </if>
  105. </set>
  106. where id_=#{id}
  107. </update>
  108. <select id="get" parameterType="string" resultMap="CompanyMemberMap">
  109. select
  110. 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 from base_company_member where id_=#{0}
  111. </select>
  112. <select id="exist" parameterType="string" resultType="int">
  113. select count(*) from base_company_member where id_=#{0}
  114. </select>
  115. <select id="list" resultMap="CompanyMemberMap">
  116. select * from base_company_member
  117. </select>
  118. <select id="search" parameterType="hashmap" resultMap="CompanyMemberMap">
  119. <![CDATA[
  120. select * from base_company_member
  121. ]]>
  122. <where>
  123. <if test="searchParams.id != null">
  124. and ID_ like #{searchParams.id}
  125. </if>
  126. <if test="searchParams.companyId != null">
  127. and company_id like #{searchParams.companyId}
  128. </if>
  129. </where>
  130. <foreach item="sort" collection="sortList" open="order by" separator=",">
  131. ${sort.name} ${sort.order}
  132. </foreach>
  133. </select>
  134. </mapper>