TEnclosureMapper.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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.ruoyi.warehouseBusiness.mapper.TEnclosureMapper">
  6. <resultMap type="TEnclosure" id="TEnclosureResult">
  7. <result property="fId" column="f_id"/>
  8. <result property="fPid" column="f_pid"/>
  9. <result property="srcId" column="src_id"/>
  10. <result property="fLineno" column="f_lineno"/>
  11. <result property="fName" column="f_name"/>
  12. <result property="fDesc" column="f_desc"/>
  13. <result property="fUrl" column="f_url"/>
  14. <result property="fType" column="f_type"/>
  15. <result property="fStatus" column="f_status"/>
  16. <result property="delFlag" column="del_flag"/>
  17. <result property="createBy" column="create_by"/>
  18. <result property="createTime" column="create_time"/>
  19. <result property="updateBy" column="update_by"/>
  20. <result property="updateTime" column="update_time"/>
  21. <result property="remark" column="remark"/>
  22. <result property="cname" column="cname"/>
  23. <result property="protocolAttributes" column="protocol_attributes"/>
  24. <result property="effectiveDateStare" column="effective_date_stare"/>
  25. <result property="effectiveDateEnd" column="effective_date_end"/>
  26. </resultMap>
  27. <sql id="selectTEnclosureVo">
  28. select f_id, f_pid, src_id, f_lineno, f_name, f_desc, f_url, f_type, f_status, del_flag, create_by, create_time, update_by, update_time, remark,
  29. cname,protocol_attributes,effective_date_stare,effective_date_end from t_enclosure
  30. </sql>
  31. <select id="selectTEnclosureList" parameterType="TEnclosure" resultMap="TEnclosureResult">
  32. <include refid="selectTEnclosureVo"/>
  33. <where>
  34. del_flag = '0'
  35. <if test="fPid != null ">and f_pid = #{fPid}</if>
  36. <if test="srcId != null ">and src_id = #{srcId}</if>
  37. <if test="fLineno != null ">and f_lineno = #{fLineno}</if>
  38. <if test="fName != null and fName != ''">and f_name like concat('%', #{fName}, '%')</if>
  39. <if test="fDesc != null and fDesc != ''">and f_desc = #{fDesc}</if>
  40. <if test="fUrl != null and fUrl != ''">and f_url = #{fUrl}</if>
  41. <if test="fType != null and fType != ''">and f_type = #{fType}</if>
  42. <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
  43. </where>
  44. </select>
  45. <select id="selectTEnclosureById" parameterType="Long" resultMap="TEnclosureResult">
  46. <include refid="selectTEnclosureVo"/>
  47. where f_id = #{fId} and del_flag = '0'
  48. </select>
  49. <select id="selectWarehouseAccessoriesList" parameterType="TEnclosure" resultMap="TEnclosureResult">
  50. <include refid="selectTEnclosureVo"/>
  51. where f_pid = #{fPid}
  52. order by create_time desc
  53. limit 0, 5
  54. </select>
  55. <select id="selectTEnclosureByPId" parameterType="long" resultMap="TEnclosureResult">
  56. <include refid="selectTEnclosureVo"/>
  57. where f_pid = #{fPid} and del_flag = '0'
  58. </select>
  59. <insert id="insertTEnclosure" parameterType="TEnclosure" useGeneratedKeys="true" keyProperty="fId">
  60. insert into t_enclosure
  61. <trim prefix="(" suffix=")" suffixOverrides=",">
  62. <if test="fPid != null">f_pid,</if>
  63. <if test="srcId != null">src_id,</if>
  64. <if test="fLineno != null">f_lineno,</if>
  65. <if test="fName != null and fName != ''">f_name,</if>
  66. <if test="fDesc != null and fDesc != ''">f_desc,</if>
  67. <if test="fUrl != null and fUrl != ''">f_url,</if>
  68. <if test="fType != null and fType != ''">f_type,</if>
  69. <if test="fStatus != null">f_status,</if>
  70. <if test="delFlag != null">del_flag,</if>
  71. <if test="createBy != null">create_by,</if>
  72. <if test="createTime != null">create_time,</if>
  73. <if test="updateBy != null">update_by,</if>
  74. <if test="updateTime != null">update_time,</if>
  75. <if test="remark != null">remark,</if>
  76. <if test="cname != null">cname,</if>
  77. <if test="protocolAttributes != null">protocol_attributes,</if>
  78. <if test="effectiveDateStare != null">effective_date_stare,</if>
  79. <if test="effectiveDateEnd != null">effective_date_end,</if>
  80. </trim>
  81. <trim prefix="values (" suffix=")" suffixOverrides=",">
  82. <if test="fPid != null">#{fPid},</if>
  83. <if test="srcId != null">#{srcId},</if>
  84. <if test="fLineno != null">#{fLineno},</if>
  85. <if test="fName != null and fName != ''">#{fName},</if>
  86. <if test="fDesc != null and fDesc != ''">#{fDesc},</if>
  87. <if test="fUrl != null and fUrl != ''">#{fUrl},</if>
  88. <if test="fType != null and fType != ''">#{fType},</if>
  89. <if test="fStatus != null">#{fStatus},</if>
  90. <if test="delFlag != null">#{delFlag},</if>
  91. <if test="createBy != null">#{createBy},</if>
  92. <if test="createTime != null">#{createTime},</if>
  93. <if test="updateBy != null">#{updateBy},</if>
  94. <if test="updateTime != null">#{updateTime},</if>
  95. <if test="remark != null">#{remark},</if>
  96. <if test="cname != null">#{cname},</if>
  97. <if test="protocolAttributes != null">#{protocolAttributes},</if>
  98. <if test="effectiveDateStare != null">#{effectiveDateStare},</if>
  99. <if test="effectiveDateEnd != null">#{effectiveDateEnd},</if>
  100. </trim>
  101. </insert>
  102. <update id="updateTEnclosure" parameterType="TEnclosure">
  103. update t_enclosure
  104. <trim prefix="SET" suffixOverrides=",">
  105. <if test="fPid != null">f_pid = #{fPid},</if>
  106. <if test="srcId != null">src_id = #{srcId},</if>
  107. <if test="fLineno != null">f_lineno = #{fLineno},</if>
  108. <if test="fName != null and fName != ''">f_name = #{fName},</if>
  109. <if test="fDesc != null and fDesc != ''">f_desc = #{fDesc},</if>
  110. <if test="fUrl != null and fUrl != ''">f_url = #{fUrl},</if>
  111. <if test="fType != null and fType != ''">f_type = #{fType},</if>
  112. <if test="fStatus != null">f_status = #{fStatus},</if>
  113. <if test="delFlag != null">del_flag = #{delFlag},</if>
  114. <if test="createBy != null">create_by = #{createBy},</if>
  115. <if test="createTime != null">create_time = #{createTime},</if>
  116. <if test="updateBy != null">update_by = #{updateBy},</if>
  117. <if test="updateTime != null">update_time = #{updateTime},</if>
  118. <if test="remark != null">remark = #{remark},</if>
  119. <if test="cname != null">cname = #{cname},</if>
  120. <if test="protocolAttributes != null">protocol_attributes = #{protocolAttributes},</if>
  121. <if test="effectiveDateStare != null">effective_date_stare = #{effectiveDateStare},</if>
  122. <if test="effectiveDateEnd != null">effective_date_end = #{effectiveDateEnd},</if>
  123. </trim>
  124. where f_id = #{fId}
  125. </update>
  126. <delete id="deleteTEnclosureById" parameterType="Long">
  127. update t_enclosure set del_flag = '1' where f_id = #{fId}
  128. </delete>
  129. <delete id="deleteByFPid" parameterType="Long">
  130. delete from t_enclosure where f_pid = #{fId}
  131. </delete>
  132. <delete id="deleteTEnclosureByIds" parameterType="String">
  133. delete from t_enclosure where f_id in
  134. <foreach item="fId" collection="array" open="(" separator="," close=")">
  135. #{fId}
  136. </foreach>
  137. </delete>
  138. <select id="selectUrlByPId" parameterType="long" resultType="string">
  139. select f_url from t_enclosure where f_pid = #{fPid} and src_id is null
  140. </select>
  141. <select id="selectTEnclosureListByPId" parameterType="long" resultMap="TEnclosureResult">
  142. <include refid="selectTEnclosureVo"/>
  143. where f_pid = #{fPid} and src_id is null
  144. </select>
  145. <select id="selectTEnclosureListBySrcId" parameterType="long" resultMap="TEnclosureResult">
  146. <include refid="selectTEnclosureVo"/>
  147. where src_id = #{srcId}
  148. </select>
  149. </mapper>