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