ConstructionProgress.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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.ConstructionProgressDAO">
  6. <resultMap id="ConstructionProgressMap" type="com.jpsoft.employment.modules.base.entity.ConstructionProgress">
  7. <id property="id" column="id_" />
  8. <result property="title" column="title_" />
  9. <result property="image" column="image_" />
  10. <result property="submitBy" column="submit_by" />
  11. <result property="submitType" column="submit_type" />
  12. <result property="submitTime" column="submit_time" />
  13. <result property="workOrderId" column="work_order_id" />
  14. <result property="index" column="index_" />
  15. <result property="createTime" column="create_time" />
  16. <result property="updateTime" column="update_time" />
  17. <result property="delFlag" column="del_flag" />
  18. <result property="createBy" column="create_by" />
  19. <result property="updateBy" column="update_by" />
  20. <result property="code" column="code_" />
  21. </resultMap>
  22. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.ConstructionProgress">
  23. <!--
  24. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  25. select sys_guid() from dual
  26. </selectKey>
  27. -->
  28. <![CDATA[
  29. insert into base_construction_progress
  30. (id_,title_,image_,submit_by,submit_type,submit_time,work_order_id,index_,create_time,update_time,del_flag,create_by,update_by,code_)
  31. values
  32. (
  33. #{id,jdbcType=VARCHAR}
  34. ,#{title,jdbcType=VARCHAR}
  35. ,#{image,jdbcType=VARCHAR}
  36. ,#{submitBy,jdbcType=VARCHAR}
  37. ,#{submitType,jdbcType=VARCHAR}
  38. ,#{submitTime,jdbcType= TIMESTAMP }
  39. ,#{workOrderId,jdbcType=VARCHAR}
  40. ,#{index,jdbcType= NUMERIC }
  41. ,#{createTime,jdbcType= TIMESTAMP }
  42. ,#{updateTime,jdbcType= TIMESTAMP }
  43. ,#{delFlag,jdbcType= NUMERIC }
  44. ,#{createBy,jdbcType=VARCHAR}
  45. ,#{updateBy,jdbcType=VARCHAR}
  46. ,#{code,jdbcType=VARCHAR}
  47. )
  48. ]]>
  49. </insert>
  50. <delete id="delete" parameterType="string">
  51. delete from base_construction_progress where id_=#{id,jdbcType=VARCHAR}
  52. </delete>
  53. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.ConstructionProgress">
  54. update base_construction_progress
  55. <set>
  56. <if test="title!=null">
  57. title_=#{title,jdbcType=VARCHAR},
  58. </if>
  59. <if test="image!=null">
  60. image_=#{image,jdbcType=VARCHAR},
  61. </if>
  62. <if test="submitBy!=null">
  63. submit_by=#{submitBy,jdbcType=VARCHAR},
  64. </if>
  65. <if test="submitType!=null">
  66. submit_type=#{submitType,jdbcType=VARCHAR},
  67. </if>
  68. <if test="submitTime!=null">
  69. submit_time=#{submitTime,jdbcType= TIMESTAMP },
  70. </if>
  71. <if test="workOrderId!=null">
  72. work_order_id=#{workOrderId,jdbcType=VARCHAR},
  73. </if>
  74. <if test="index!=null">
  75. index_=#{index,jdbcType= NUMERIC },
  76. </if>
  77. <if test="createTime!=null">
  78. create_time=#{createTime,jdbcType= TIMESTAMP },
  79. </if>
  80. <if test="updateTime!=null">
  81. update_time=#{updateTime,jdbcType= TIMESTAMP },
  82. </if>
  83. <if test="delFlag!=null">
  84. del_flag=#{delFlag,jdbcType= NUMERIC },
  85. </if>
  86. <if test="createBy!=null">
  87. create_by=#{createBy,jdbcType=VARCHAR},
  88. </if>
  89. <if test="updateBy!=null">
  90. update_by=#{updateBy,jdbcType=VARCHAR},
  91. </if>
  92. <if test="code!=null">
  93. code_=#{code,jdbcType=VARCHAR},
  94. </if>
  95. </set>
  96. where id_=#{id}
  97. </update>
  98. <select id="get" parameterType="string" resultMap="ConstructionProgressMap">
  99. select
  100. id_,title_,image_,submit_by,submit_type,submit_time,work_order_id,index_,create_time,update_time,del_flag,create_by,update_by from base_construction_progress where id_=#{0}
  101. </select>
  102. <select id="exist" parameterType="string" resultType="int">
  103. select count(*) from base_construction_progress where id_=#{0}
  104. </select>
  105. <select id="list" resultMap="ConstructionProgressMap">
  106. select * from base_construction_progress
  107. </select>
  108. <select id="findByWorkOrderId" resultMap="ConstructionProgressMap">
  109. select * from base_construction_progress where del_flag=false and work_order_id=#{0}
  110. </select>
  111. <select id="findLastByWorkOrderId" resultMap="ConstructionProgressMap">
  112. select * from base_construction_progress
  113. where del_flag=false
  114. and work_order_id=#{0}
  115. order by create_time desc
  116. limit 1
  117. </select>
  118. <select id="search" parameterType="hashmap" resultMap="ConstructionProgressMap">
  119. <![CDATA[
  120. select * from base_construction_progress
  121. ]]>
  122. <where>
  123. <if test="searchParams.id != null">
  124. and ID_ like #{searchParams.id}
  125. </if>
  126. </where>
  127. <foreach item="sort" collection="sortList" open="order by" separator=",">
  128. ${sort.name} ${sort.order}
  129. </foreach>
  130. </select>
  131. <select id="getIndex" resultType="integer">
  132. select index_ from base_construction_progress
  133. where del_flag=false
  134. and work_order_id=#{0}
  135. order by index_ desc
  136. limit 1
  137. </select>
  138. <select id="getSubmitTime" resultType="date">
  139. select submit_time from base_construction_progress
  140. where del_flag = false
  141. and code_ = #{code}
  142. and work_order_id = #{workOrderId}
  143. </select>
  144. </mapper>