LaborerInfo.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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.employment.modules.base.dao.LaborerInfoDAO">
  6. <resultMap id="LaborerInfoMap" type="com.jpsoft.employment.modules.base.entity.LaborerInfo">
  7. <id property="id" column="id_" />
  8. <result property="name" column="name_" />
  9. <result property="phone" column="phone_" />
  10. <result property="idCard" column="id_card" />
  11. <result property="age" column="age_" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateTime" column="update_time" />
  14. <result property="createBy" column="create_by" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="delFlag" column="del_flag" />
  17. <result property="introduction" column="introduction_" />
  18. </resultMap>
  19. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.LaborerInfo">
  20. <!--
  21. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  22. select sys_guid() from dual
  23. </selectKey>
  24. -->
  25. <![CDATA[
  26. insert into base_laborer_info
  27. (id_,name_,phone_,id_card,age_,create_time,update_time,create_by,update_by,del_flag,introduction_)
  28. values
  29. (
  30. #{id,jdbcType=VARCHAR}
  31. ,#{name,jdbcType=VARCHAR}
  32. ,#{phone,jdbcType=VARCHAR}
  33. ,#{idCard,jdbcType=VARCHAR}
  34. ,#{age,jdbcType= NUMERIC }
  35. ,#{createTime,jdbcType= TIMESTAMP }
  36. ,#{updateTime,jdbcType= TIMESTAMP }
  37. ,#{createBy,jdbcType=VARCHAR}
  38. ,#{updateBy,jdbcType=VARCHAR}
  39. ,#{delFlag,jdbcType= NUMERIC }
  40. ,#{introduction,jdbcType=VARCHAR}
  41. )
  42. ]]>
  43. </insert>
  44. <delete id="delete" parameterType="string">
  45. delete from base_laborer_info where id_=#{id,jdbcType=VARCHAR}
  46. </delete>
  47. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.LaborerInfo">
  48. update base_laborer_info
  49. <set>
  50. <if test="name!=null">
  51. name_=#{name,jdbcType=VARCHAR},
  52. </if>
  53. <if test="phone!=null">
  54. phone_=#{phone,jdbcType=VARCHAR},
  55. </if>
  56. <if test="idCard!=null">
  57. id_card=#{idCard,jdbcType=VARCHAR},
  58. </if>
  59. <if test="age!=null">
  60. age_=#{age,jdbcType= NUMERIC },
  61. </if>
  62. <if test="createTime!=null">
  63. create_time=#{createTime,jdbcType= TIMESTAMP },
  64. </if>
  65. <if test="updateTime!=null">
  66. update_time=#{updateTime,jdbcType= TIMESTAMP },
  67. </if>
  68. <if test="createBy!=null">
  69. create_by=#{createBy,jdbcType=VARCHAR},
  70. </if>
  71. <if test="updateBy!=null">
  72. update_by=#{updateBy,jdbcType=VARCHAR},
  73. </if>
  74. <if test="delFlag!=null">
  75. del_flag=#{delFlag,jdbcType= NUMERIC },
  76. </if>
  77. <if test="introduction!=null">
  78. introduction_=#{introduction,jdbcType=VARCHAR},
  79. </if>
  80. </set>
  81. where id_=#{id}
  82. </update>
  83. <select id="get" parameterType="string" resultMap="LaborerInfoMap">
  84. select * from base_laborer_info where id_=#{0}
  85. </select>
  86. <select id="exist" parameterType="string" resultType="int">
  87. select count(*) from base_laborer_info where id_=#{0}
  88. </select>
  89. <select id="list" resultMap="LaborerInfoMap">
  90. select * from base_laborer_info where del_flag=false order by create_time desc
  91. </select>
  92. <select id="listByIndex" resultMap="LaborerInfoMap">
  93. select * from base_laborer_info where del_flag=false order by create_time desc limit #{0}
  94. </select>
  95. <select id="findByCustomerId" resultMap="LaborerInfoMap">
  96. select * from base_laborer_info where del_flag=false and customer_id=#{0}
  97. </select>
  98. <select id="search" parameterType="hashmap" resultMap="LaborerInfoMap">
  99. <![CDATA[
  100. select * from base_laborer_info
  101. ]]>
  102. <where>
  103. <if test="searchParams.id != null">
  104. and ID_ like #{searchParams.id}
  105. </if>
  106. </where>
  107. <foreach item="sort" collection="sortList" open="order by" separator=",">
  108. ${sort.name} ${sort.order}
  109. </foreach>
  110. </select>
  111. <select id="searchMobile" parameterType="hashmap" resultMap="LaborerInfoMap">
  112. <![CDATA[
  113. select * from base_laborer_info
  114. ]]>
  115. <where>
  116. <if test="searchParams.name != null">
  117. and name_ like #{searchParams.name}
  118. </if>
  119. </where>
  120. <foreach item="sort" collection="sortList" open="order by" separator=",">
  121. ${sort.name} ${sort.order}
  122. </foreach>
  123. </select>
  124. </mapper>