ConstructionProgress.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. </resultMap>
  21. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.ConstructionProgress">
  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_construction_progress
  29. (id_,title_,image_,submit_by,submit_type,submit_time,work_order_id,index_,create_time,update_time,del_flag,create_by,update_by)
  30. values
  31. (
  32. #{id,jdbcType=VARCHAR}
  33. ,#{title,jdbcType=VARCHAR}
  34. ,#{image,jdbcType=VARCHAR}
  35. ,#{submitBy,jdbcType=VARCHAR}
  36. ,#{submitType,jdbcType=VARCHAR}
  37. ,#{submitTime,jdbcType= TIMESTAMP }
  38. ,#{workOrderId,jdbcType=VARCHAR}
  39. ,#{index,jdbcType= NUMERIC }
  40. ,#{createTime,jdbcType= TIMESTAMP }
  41. ,#{updateTime,jdbcType= TIMESTAMP }
  42. ,#{delFlag,jdbcType= NUMERIC }
  43. ,#{createBy,jdbcType=VARCHAR}
  44. ,#{updateBy,jdbcType=VARCHAR}
  45. )
  46. ]]>
  47. </insert>
  48. <delete id="delete" parameterType="string">
  49. delete from base_construction_progress where id_=#{id,jdbcType=VARCHAR}
  50. </delete>
  51. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.ConstructionProgress">
  52. update base_construction_progress
  53. <set>
  54. <if test="title!=null">
  55. title_=#{title,jdbcType=VARCHAR},
  56. </if>
  57. <if test="image!=null">
  58. image_=#{image,jdbcType=VARCHAR},
  59. </if>
  60. <if test="submitBy!=null">
  61. submit_by=#{submitBy,jdbcType=VARCHAR},
  62. </if>
  63. <if test="submitType!=null">
  64. submit_type=#{submitType,jdbcType=VARCHAR},
  65. </if>
  66. <if test="submitTime!=null">
  67. submit_time=#{submitTime,jdbcType= TIMESTAMP },
  68. </if>
  69. <if test="workOrderId!=null">
  70. work_order_id=#{workOrderId,jdbcType=VARCHAR},
  71. </if>
  72. <if test="index!=null">
  73. index_=#{index,jdbcType= NUMERIC },
  74. </if>
  75. <if test="createTime!=null">
  76. create_time=#{createTime,jdbcType= TIMESTAMP },
  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="createBy!=null">
  85. create_by=#{createBy,jdbcType=VARCHAR},
  86. </if>
  87. <if test="updateBy!=null">
  88. update_by=#{updateBy,jdbcType=VARCHAR},
  89. </if>
  90. </set>
  91. where id_=#{id}
  92. </update>
  93. <select id="get" parameterType="string" resultMap="ConstructionProgressMap">
  94. select
  95. 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}
  96. </select>
  97. <select id="exist" parameterType="string" resultType="int">
  98. select count(*) from base_construction_progress where id_=#{0}
  99. </select>
  100. <select id="list" resultMap="ConstructionProgressMap">
  101. select * from base_construction_progress
  102. </select>
  103. <select id="findByWorkOrderId" resultMap="ConstructionProgressMap">
  104. select * from base_construction_progress where del_flag=false and work_order_id=#{0}
  105. </select>
  106. <select id="search" parameterType="hashmap" resultMap="ConstructionProgressMap">
  107. <![CDATA[
  108. select * from base_construction_progress
  109. ]]>
  110. <where>
  111. <if test="searchParams.id != null">
  112. and ID_ like #{searchParams.id}
  113. </if>
  114. </where>
  115. <foreach item="sort" collection="sortList" open="order by" separator=",">
  116. ${sort.name} ${sort.order}
  117. </foreach>
  118. </select>
  119. <select id="getIndex" resultType="integer">
  120. select index_ from base_construction_progress
  121. where del_flag=false
  122. and work_order_id=#{0}
  123. order by index_ desc
  124. limit 1
  125. </select>
  126. </mapper>