DzCardsOpenMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.dz.mapper.DzCardsOpenMapper">
  6. <resultMap type="DzCardsOpen" id="DzCardsOpenResult">
  7. <result property="id" column="id" />
  8. <result property="agentId" column="agent_id" />
  9. <result property="startNo" column="start_no" />
  10. <result property="endNo" column="end_no" />
  11. <result property="endDate" column="end_date" />
  12. <result property="location" column="location" />
  13. <result property="schoolId" column="school_id" />
  14. <result property="deptId" column="dept_id" />
  15. <result property="sender" column="sender" />
  16. <result property="createTime" column="create_time" />
  17. <result property="isReopen" column="is_reopen" />
  18. <result property="status" column="status" />
  19. <result property="auditDesc" column="audit_desc" />
  20. <result property="cardType" column="card_type" />
  21. </resultMap>
  22. <sql id="selectDzCardsOpenVo">
  23. select id, agent_id, start_no, end_no, end_date, location, school_id, dept_id, sender, create_time, is_reopen, status, audit_desc, card_type from dz_cards_open
  24. </sql>
  25. <select id="selectDzCardsOpenList" parameterType="DzCardsOpen" resultMap="DzCardsOpenResult">
  26. <include refid="selectDzCardsOpenVo"/>
  27. <where>
  28. <if test="agentId != null "> and agent_id = #{agentId}</if>
  29. <if test="startNo != null and startNo != ''"> and start_no = #{startNo}</if>
  30. <if test="endNo != null and endNo != ''"> and end_no = #{endNo}</if>
  31. <if test="endDate != null "> and end_date = #{endDate}</if>
  32. <if test="location != null "> and location = #{location}</if>
  33. <if test="schoolId != null "> and school_id = #{schoolId}</if>
  34. <if test="deptId != null "> and dept_id = #{deptId}</if>
  35. <if test="sender != null and sender != ''"> and sender = #{sender}</if>
  36. <if test="isReopen != null "> and is_reopen = #{isReopen}</if>
  37. <if test="status != null "> and status = #{status}</if>
  38. <if test="cardType != null "> and card_type = #{cardType}</if>
  39. </where>
  40. </select>
  41. <select id="selectDzCardsOpenById" parameterType="Long" resultMap="DzCardsOpenResult">
  42. <include refid="selectDzCardsOpenVo"/>
  43. where id = #{id}
  44. </select>
  45. <insert id="insertDzCardsOpen" parameterType="DzCardsOpen" useGeneratedKeys="true" keyProperty="id">
  46. insert into dz_cards_open
  47. <trim prefix="(" suffix=")" suffixOverrides=",">
  48. <if test="agentId != null">agent_id,</if>
  49. <if test="startNo != null">start_no,</if>
  50. <if test="endNo != null">end_no,</if>
  51. <if test="endDate != null">end_date,</if>
  52. <if test="location != null">location,</if>
  53. <if test="schoolId != null">school_id,</if>
  54. <if test="deptId != null">dept_id,</if>
  55. <if test="sender != null">sender,</if>
  56. <if test="createTime != null">create_time,</if>
  57. <if test="isReopen != null">is_reopen,</if>
  58. <if test="status != null">status,</if>
  59. <if test="cardType != null">card_type,</if>
  60. </trim>
  61. <trim prefix="values (" suffix=")" suffixOverrides=",">
  62. <if test="agentId != null">#{agentId},</if>
  63. <if test="startNo != null">#{startNo},</if>
  64. <if test="endNo != null">#{endNo},</if>
  65. <if test="endDate != null">#{endDate},</if>
  66. <if test="location != null">#{location},</if>
  67. <if test="schoolId != null">#{schoolId},</if>
  68. <if test="deptId != null">#{deptId},</if>
  69. <if test="sender != null">#{sender},</if>
  70. <if test="createTime != null">#{createTime},</if>
  71. <if test="isReopen != null">#{isReopen},</if>
  72. <if test="status != null">#{status},</if>
  73. <if test="cardType != null">#{cardType},</if>
  74. </trim>
  75. </insert>
  76. <update id="updateDzCardsOpen" parameterType="DzCardsOpen">
  77. update dz_cards_open
  78. <trim prefix="SET" suffixOverrides=",">
  79. <if test="agentId != null">agent_id = #{agentId},</if>
  80. <if test="startNo != null">start_no = #{startNo},</if>
  81. <if test="endNo != null">end_no = #{endNo},</if>
  82. <if test="endDate != null">end_date = #{endDate},</if>
  83. <if test="location != null">location = #{location},</if>
  84. <if test="schoolId != null">school_id = #{schoolId},</if>
  85. <if test="deptId != null">dept_id = #{deptId},</if>
  86. <if test="sender != null">sender = #{sender},</if>
  87. <if test="createTime != null">create_time = #{createTime},</if>
  88. <if test="isReopen != null">is_reopen = #{isReopen},</if>
  89. <if test="status != null">status = #{status},</if>
  90. <if test="cardType != null">card_type = #{cardType},</if>
  91. <if test="auditDesc != null ">audit_desc = #{auditDesc}</if>
  92. </trim>
  93. where id = #{id}
  94. </update>
  95. <delete id="deleteDzCardsOpenById" parameterType="Long">
  96. delete from dz_cards_open where id = #{id}
  97. </delete>
  98. <delete id="deleteDzCardsOpenByIds" parameterType="String">
  99. delete from dz_cards_open where id in
  100. <foreach item="id" collection="array" open="(" separator="," close=")">
  101. #{id}
  102. </foreach>
  103. </delete>
  104. </mapper>