TBranchManageMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.branch.mapper.TBranchManageMapper">
  6. <resultMap type="TBranchManage" id="TBranchManageResult">
  7. <result property="manageId" column="manage_id" />
  8. <result property="monthly" column="monthly" />
  9. <result property="year" column="year" />
  10. <result property="describe" column="describe" />
  11. <result property="remarks" column="remarks" />
  12. <result property="delFlag" column="del_flag" />
  13. <result property="createBy" column="create_by" />
  14. <result property="createTime" column="create_time" />
  15. <result property="updateBy" column="update_by" />
  16. <result property="updateTime" column="update_time" />
  17. <result property="deptId" column="dept_id" />
  18. <result property="filesId" column="files_id" />
  19. </resultMap>
  20. <sql id="selectTBranchManageVo">
  21. select u.manage_id, u.monthly, u.year, u.describe, u.remarks, u.del_flag, u.create_by, u.create_time, u.update_by, u.update_time, u.dept_id, u.files_id from t_branch_manage u left join sys_dept d on u.dept_id = d.dept_id
  22. </sql>
  23. <select id="selectTBranchManageList" parameterType="TBranchManage" resultMap="TBranchManageResult">
  24. <include refid="selectTBranchManageVo"/>
  25. <where>
  26. <if test="manageId != null "> and u.manage_id = #{manageId}</if>
  27. <if test="monthly != null "> and u.monthly = #{monthly}</if>
  28. <if test="year != null "> and u.year=#{year}</if>
  29. <if test="describe != null and describe != ''"> and u.describe = #{describe}</if>
  30. <if test="remarks != null and remarks != ''"> and u.remarks = #{remarks}</if>
  31. <if test="deptId != null "> and u.dept_id = #{deptId}</if>
  32. <if test="filesId != null and filesId != ''"> and u.files_id = #{filesId}</if>
  33. and u.del_flag = 0
  34. </where>
  35. <!-- 数据范围过滤 -->
  36. ${params.dataScope}
  37. </select>
  38. <select id="selectTBranchManageByManageId" parameterType="Long" resultMap="TBranchManageResult">
  39. <include refid="selectTBranchManageVo"/>
  40. where u.manage_id = #{manageId}
  41. and u.del_flag = 0
  42. </select>
  43. <insert id="insertTBranchManage" parameterType="TBranchManage">
  44. <selectKey keyProperty="manageId" resultType="long" order="BEFORE">
  45. SELECT seq_t_branch_manage.NEXTVAL as id FROM DUAL
  46. </selectKey>
  47. insert into t_branch_manage
  48. <trim prefix="(" suffix=")" suffixOverrides=",">
  49. <if test="manageId != null">manage_id,</if>
  50. <if test="monthly != null">monthly,</if>
  51. <if test="year != null">year,</if>
  52. <if test="describe != null">describe,</if>
  53. <if test="remarks != null">remarks,</if>
  54. <if test="delFlag != null">del_flag,</if>
  55. <if test="createBy != null">create_by,</if>
  56. <if test="createTime != null">create_time,</if>
  57. <if test="updateBy != null">update_by,</if>
  58. <if test="updateTime != null">update_time,</if>
  59. <if test="deptId != null">dept_id,</if>
  60. <if test="filesId != null">files_id,</if>
  61. </trim>
  62. <trim prefix="values (" suffix=")" suffixOverrides=",">
  63. <if test="manageId != null">#{manageId},</if>
  64. <if test="monthly != null">#{monthly},</if>
  65. <if test="year != null">#{year},</if>
  66. <if test="describe != null">#{describe},</if>
  67. <if test="remarks != null">#{remarks},</if>
  68. <if test="delFlag != null">#{delFlag},</if>
  69. <if test="createBy != null">#{createBy},</if>
  70. <if test="createTime != null">#{createTime},</if>
  71. <if test="updateBy != null">#{updateBy},</if>
  72. <if test="updateTime != null">#{updateTime},</if>
  73. <if test="deptId != null">#{deptId},</if>
  74. <if test="filesId != null">#{filesId},</if>
  75. </trim>
  76. </insert>
  77. <update id="updateTBranchManage" parameterType="TBranchManage">
  78. update t_branch_manage
  79. <trim prefix="SET" suffixOverrides=",">
  80. <if test="monthly != null">monthly = #{monthly},</if>
  81. <if test="year != null">year = #{year},</if>
  82. <if test="describe != null">describe = #{describe},</if>
  83. <if test="remarks != null">remarks = #{remarks},</if>
  84. <if test="delFlag != null">del_flag = #{delFlag},</if>
  85. <if test="createBy != null">create_by = #{createBy},</if>
  86. <if test="createTime != null">create_time = #{createTime},</if>
  87. <if test="updateBy != null">update_by = #{updateBy},</if>
  88. <if test="updateTime != null">update_time = #{updateTime},</if>
  89. <if test="deptId != null">dept_id = #{deptId},</if>
  90. <if test="filesId != null">files_id = #{filesId},</if>
  91. </trim>
  92. where manage_id = #{manageId}
  93. </update>
  94. <update id="deleteTBranchManageByManageId" parameterType="Long">
  95. update t_branch_manage set del_flag = 2 where manage_id = #{manageId}
  96. </update>
  97. <update id="deleteTBranchManageByManageIds" parameterType="String">
  98. update t_branch_manage set del_flag = 2 where manage_id in
  99. <foreach item="manageId" collection="array" open="(" separator="," close=")">
  100. #{manageId}
  101. </foreach>
  102. </update>
  103. </mapper>