DcSystemMapper.xml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.gqy.document.mapper.DcSystemMapper">
  4. <resultMap type="DcSystem" id="DcSystemResult">
  5. <id property="sysId" column="sys_id" />
  6. <result property="sysName" column="sys_name" />
  7. <result property="sysNo" column="sys_no" />
  8. <result property="sysRemark" column="sys_remark" />
  9. <result property="sysProducts" column="sys_products" />
  10. <result property="sysStatus" column="sys_status" />
  11. </resultMap>
  12. <sql id="selectDcSystemVo">
  13. select sys_id, sys_name, sys_no, sys_remark, sys_products,sys_status
  14. from dc_system
  15. </sql>
  16. <select id="selectDcSystemList" parameterType="DcSystem" resultMap="DcSystemResult">
  17. <include refid="selectDcSystemVo"/>
  18. <where>
  19. <if test="sysId!= null">
  20. AND sys_id = #{sysId}
  21. </if>
  22. <if test="sysName != null and sysName != ''">
  23. AND sys_name like concat('%', #{sysName}, '%')
  24. </if>
  25. <if test="sysNo != null and sysNo != ''">
  26. AND sys_no = #{sysNo}
  27. </if>
  28. <if test="sysStatus!= null">
  29. AND sys_status = #{sysStatus}
  30. </if>
  31. </where>
  32. order by sys_id desc
  33. </select>
  34. <select id="selectDcSystemById" parameterType="Long" resultMap="DcSystemResult">
  35. <include refid="selectDcSystemVo"/>
  36. where sys_id = #{sys_id}
  37. </select>
  38. <insert id="insertDcSystem" parameterType="DcSystem" useGeneratedKeys="true" keyProperty="sysId">
  39. insert into dc_system
  40. <trim prefix="(" suffix=")" suffixOverrides=",">
  41. <if test="sysName != null">sys_name,</if>
  42. <if test="sysNo != null">sys_no,</if>
  43. <if test="sysRemark != null">sys_remark,</if>
  44. <if test="sysProducts != null">sys_products,</if>
  45. <if test="sysStatus != null">sys_status,</if>
  46. </trim>
  47. <trim prefix="values (" suffix=")" suffixOverrides=",">
  48. <if test="sysName != null">#{sysName},</if>
  49. <if test="sysNo != null">#{sysNo},</if>
  50. <if test="sysRemark != null">#{sysRemark},</if>
  51. <if test="sysProducts != null">#{sysProducts},</if>
  52. <if test="sysStatus != null">#{sysStatus}</if>
  53. </trim>
  54. </insert>
  55. <update id="updateDcSystem" parameterType="DcSystem">
  56. update dc_system
  57. <set>
  58. <if test="sysName != null">sys_name = #{sysName},</if>
  59. <if test="sysNo != null">sys_no = #{sysNo},</if>
  60. <if test="sysRemark != null">sys_remark = #{sysRemark},</if>
  61. <if test="sysProducts != null">sys_products = #{sysProducts}</if>
  62. <if test="sysStatus != null">sys_status = #{sysStatus}</if>
  63. </set>
  64. where sys_id = #{sysId}
  65. </update>
  66. <delete id="deleteDcSystemById" parameterType="Long">
  67. delete from dc_system where sys_id = #{sys_id}
  68. </delete>
  69. <delete id="deleteDcSystemByIds" parameterType="String">
  70. delete from dc_system where sys_id in
  71. <foreach item="sys_id" collection="array" open="(" separator="," close=")">
  72. #{sys_id}
  73. </foreach>
  74. </delete>
  75. </mapper>