QwSopTempMapper.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.fs.sop.mapper.QwSopTempMapper">
  6. <resultMap type="QwSopTemp" id="QwSopTempResult">
  7. <result property="id" column="id" />
  8. <result property="name" column="name" />
  9. <result property="setting" column="setting" />
  10. <result property="status" column="status" />
  11. <result property="sort" column="sort" />
  12. <result property="createTime" column="create_time" />
  13. <result property="createBy" column="create_by" />
  14. <result property="companyId" column="company_id" />
  15. <result property="gap" column="gap" />
  16. <result property="sendType" column="send_type" />
  17. <result property="updateTime" column="update_time" />
  18. </resultMap>
  19. <sql id="selectQwSopTempVo">
  20. select * from qw_sop_temp
  21. </sql>
  22. <select id="selectQwSopTempList" resultType="QwSopTemp" resultMap="QwSopTempResult">
  23. <include refid="selectQwSopTempVo"/>
  24. <where>
  25. <if test="id != null "> and id = #{id}</if>
  26. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  27. <if test="setting != null and setting != ''"> and setting = #{setting}</if>
  28. <if test="status != null and status != ''"> and status = #{status}</if>
  29. <if test="sort != null "> and sort = #{sort}</if>
  30. <if test="companyId != null "> and company_id = #{companyId}</if>
  31. <if test="sendType != null "> and send_type = #{sendType}</if>
  32. </where>
  33. </select>
  34. <select id="selectQwSopTempListNew" resultType="QwSopTemp" resultMap="QwSopTempResult">
  35. select * from qw_sop_temp
  36. <where>
  37. <if test="id != null "> and id = #{id}</if>
  38. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  39. <if test="status != null and status != ''"> and status = #{status}</if>
  40. <if test="sort != null "> and sort = #{sort}</if>
  41. <if test="companyId != null "> and company_id = #{companyId}</if>
  42. <if test="sendType != null "> and send_type = #{sendType}</if>
  43. <if test="createBy != null "> and create_by = #{createBy}</if>
  44. <if test="cuDeptIdList != null and !cuDeptIdList.isEmpty()">
  45. AND create_by_dept IN
  46. <foreach collection='cuDeptIdList' item='item' open='(' separator=',' close=')'>
  47. #{item}
  48. </foreach>
  49. </if>
  50. <if test="userIds != null and !userIds.isEmpty()">
  51. AND create_by IN
  52. <foreach collection='userIds' item='item' open='(' separator=',' close=')'>
  53. #{item}
  54. </foreach>
  55. </if>
  56. </where>
  57. order by sort,create_time desc
  58. </select>
  59. <select id="selectQwSopTempById" parameterType="String" resultMap="QwSopTempResult">
  60. <include refid="selectQwSopTempVo"/>
  61. where id = #{id}
  62. </select>
  63. <select id="listTemp" resultType="com.fs.sop.domain.QwSopTemp">
  64. select * from qw_sop_temp_temp
  65. </select>
  66. <select id="selectListByIds" resultType="com.fs.sop.domain.QwSopTemp">
  67. select * from qw_sop_temp where id in
  68. <foreach item="id" collection="ids" open="(" separator="," close=")">
  69. #{id}
  70. </foreach>
  71. </select>
  72. <insert id="insertQwSopTemp" parameterType="QwSopTemp" useGeneratedKeys="true" keyProperty="id">
  73. insert into qw_sop_temp
  74. <trim prefix="(" suffix=")" suffixOverrides=",">
  75. <if test="data.id != null">id,</if>
  76. <if test="data.name != null">name,</if>
  77. <if test="data.setting != null">setting,</if>
  78. <if test="data.status != null">status,</if>
  79. <if test="data.sort != null">sort,</if>
  80. <if test="data.createTime != null">create_time,</if>
  81. <if test="data.createBy != null">create_by,</if>
  82. <if test="data.companyId != null">company_id,</if>
  83. <if test="data.gap != null">gap,</if>
  84. <if test="data.sendType != null">send_type,</if>
  85. <if test="data.updateTime != null">update_time,</if>
  86. </trim>
  87. <trim prefix="values (" suffix=")" suffixOverrides=",">
  88. <if test="data.id != null">#{data.id},</if>
  89. <if test="data.name != null">#{data.name},</if>
  90. <if test="data.setting != null">#{data.setting},</if>
  91. <if test="data.status != null">#{data.status},</if>
  92. <if test="data.sort != null">#{data.sort},</if>
  93. <if test="data.createTime != null">#{data.createTime},</if>
  94. <if test="data.createBy != null">#{data.createBy},</if>
  95. <if test="data.companyId != null">#{data.companyId},</if>
  96. <if test="data.gap != null">#{data.gap},</if>
  97. <if test="data.sendType != null">#{data.sendType},</if>
  98. <if test="data.updateTime != null">#{data.updateTime},</if>
  99. </trim>
  100. </insert>
  101. <update id="updateQwSopTemp" parameterType="QwSopTemp" useGeneratedKeys="false" keyProperty="id" >
  102. update qw_sop_temp
  103. <trim prefix="SET" suffixOverrides=",">
  104. <if test="data.name != null">name = #{data.name},</if>
  105. <if test="data.setting != null">setting = #{data.setting},</if>
  106. <if test="data.status != null">status = #{data.status},</if>
  107. <if test="data.sort != null">sort = #{data.sort},</if>
  108. <if test="data.createTime != null">create_time = #{data.createTime},</if>
  109. <if test="data.createBy != null">create_by = #{data.createBy},</if>
  110. <if test="data.companyId != null">company_id = #{data.companyId},</if>
  111. <if test="data.gap != null">gap = #{data.gap},</if>
  112. <if test="data.sendType != null">send_type = #{data.sendType},</if>
  113. <if test="data.updateTime != null">update_time = #{data.updateTime},</if>
  114. </trim>
  115. where id = #{data.id}
  116. </update>
  117. <delete id="deleteQwSopTempById" parameterType="String">
  118. delete from qw_sop_temp where id = #{id}
  119. </delete>
  120. <delete id="deleteQwSopTempByIds" parameterType="String">
  121. delete from qw_sop_temp where id in
  122. <foreach item="id" collection="array" open="(" separator="," close=")">
  123. #{id}
  124. </foreach>
  125. </delete>
  126. <!-- <update id="updateQwSopTempByIds" parameterType="String">-->
  127. <!-- ALTER TABLE qw_sop_temp-->
  128. <!-- UPDATE status = 0-->
  129. <!-- WHERE id IN-->
  130. <!-- <foreach item="id" collection="ids" open="(" separator="," close=")">-->
  131. <!-- CAST(#{id} AS UUID)-->
  132. <!-- </foreach>-->
  133. <!-- </update>-->
  134. <update id="updateQwSopTempByIds" parameterType="String">
  135. UPDATE qw_sop_temp set status = 2
  136. WHERE id IN
  137. <foreach item="id" collection="ids" open="(" separator="," close=")">
  138. #{id}
  139. </foreach>
  140. </update>
  141. </mapper>