TPsDevFgsMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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.project.ps.dev.mapper.TPsDevFgsMapper">
  6. <resultMap type="TPsDevFgs" id="TPsDevFgsResult">
  7. <result property="id" column="id" />
  8. <result property="fgsNo" column="fgs_no" />
  9. <result property="position" column="position" />
  10. <result property="delFlag" column="del_flag" />
  11. <result property="createrCode" column="creater_code" />
  12. <result property="createdate" column="createdate" />
  13. <result property="updaterCode" column="updater_code" />
  14. <result property="updatedate" column="updatedate" />
  15. <result property="remarks" column="remarks" />
  16. <result property="deptId" column="dept_id" />
  17. <result property="status" column="status" />
  18. <result property="patrolType" column="patrol_type" />
  19. <result property="deptName" column="dept_name" />
  20. </resultMap>
  21. <sql id="selectTPsDevFgsVo">
  22. select d.id, d.fgs_no, d.position, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id, d.status, d.patrol_type ,s.dept_name from t_ps_dev_fgs d
  23. left join sys_dept s on s.dept_id = d.dept_id
  24. </sql>
  25. <select id="selectTPsDevFgsList" parameterType="TPsDevFgs" resultMap="TPsDevFgsResult">
  26. <include refid="selectTPsDevFgsVo"/>
  27. <where>
  28. <if test="fgsNo != null and fgsNo != ''"> and fgs_no = #{fgsNo}</if>
  29. <if test="position != null and position != ''"> and position = #{position}</if>
  30. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  31. <if test="createdate != null "> and createdate = #{createdate}</if>
  32. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  33. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  34. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  35. <if test="deptId != null "> and dept_id = #{deptId}</if>
  36. <if test="status != null and status != ''"> and d.status = #{status}</if>
  37. <if test="patrolType != null and patrolType != ''"> and patrol_type = #{patrolType}</if>
  38. and d.del_flag = 0
  39. </where>
  40. <!-- 数据范围过滤 -->
  41. ${params.dataScope}
  42. </select>
  43. <select id="selectTPsDevFgsById" parameterType="Long" resultMap="TPsDevFgsResult">
  44. <include refid="selectTPsDevFgsVo"/>
  45. where id = #{id}
  46. </select>
  47. <insert id="insertTPsDevFgs" parameterType="TPsDevFgs">
  48. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  49. SELECT seq_t_ps_dev_fgs.NEXTVAL as id FROM DUAL
  50. </selectKey>
  51. insert into t_ps_dev_fgs
  52. <trim prefix="(" suffix=")" suffixOverrides=",">
  53. <if test="id != null">id,</if>
  54. <if test="fgsNo != null">fgs_no,</if>
  55. <if test="position != null">position,</if>
  56. <if test="delFlag != null">del_flag,</if>
  57. <if test="createrCode != null">creater_code,</if>
  58. <if test="createdate != null">createdate,</if>
  59. <if test="updaterCode != null">updater_code,</if>
  60. <if test="updatedate != null">updatedate,</if>
  61. <if test="remarks != null">remarks,</if>
  62. <if test="deptId != null">dept_id,</if>
  63. <if test="status != null">status,</if>
  64. <if test="patrolType != null">patrol_type,</if>
  65. </trim>
  66. <trim prefix="values (" suffix=")" suffixOverrides=",">
  67. <if test="id != null">#{id},</if>
  68. <if test="fgsNo != null">#{fgsNo},</if>
  69. <if test="position != null">#{position},</if>
  70. <if test="delFlag != null">#{delFlag},</if>
  71. <if test="createrCode != null">#{createrCode},</if>
  72. <if test="createdate != null">#{createdate},</if>
  73. <if test="updaterCode != null">#{updaterCode},</if>
  74. <if test="updatedate != null">#{updatedate},</if>
  75. <if test="remarks != null">#{remarks},</if>
  76. <if test="deptId != null">#{deptId},</if>
  77. <if test="status != null">#{status},</if>
  78. <if test="patrolType != null">#{patrolType},</if>
  79. </trim>
  80. </insert>
  81. <update id="updateTPsDevFgs" parameterType="TPsDevFgs">
  82. update t_ps_dev_fgs
  83. <trim prefix="SET" suffixOverrides=",">
  84. <if test="fgsNo != null">fgs_no = #{fgsNo},</if>
  85. <if test="position != null">position = #{position},</if>
  86. <if test="delFlag != null">del_flag = #{delFlag},</if>
  87. <if test="createrCode != null">creater_code = #{createrCode},</if>
  88. <if test="createdate != null">createdate = #{createdate},</if>
  89. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  90. <if test="updatedate != null">updatedate = #{updatedate},</if>
  91. <if test="remarks != null">remarks = #{remarks},</if>
  92. <if test="deptId != null">dept_id = #{deptId},</if>
  93. <if test="status != null">status = #{status},</if>
  94. <if test="patrolType != null">patrol_type = #{patrolType},</if>
  95. </trim>
  96. where id = #{id}
  97. </update>
  98. <update id="deleteTPsDevFgsById" parameterType="Long">
  99. update t_ps_dev_fgs set del_flag = 2 where id = #{id}
  100. </update>
  101. <update id="deleteTPsDevFgsByIds" parameterType="String">
  102. update t_ps_dev_fgs set del_flag = 2 where id in
  103. <foreach item="id" collection="array" open="(" separator="," close=")">
  104. #{id}
  105. </foreach>
  106. </update>
  107. <select id="countByStatus" resultType="long">
  108. select count(*) from t_ps_dev_fgs where status = '1' and del_flag = 0
  109. </select>
  110. </mapper>