TStYearplanMapper.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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.training.spec.mapper.TStYearplanMapper">
  6. <resultMap type="TStYearplan" id="TStYearplanResult">
  7. <result property="id" column="id" />
  8. <result property="staffId" column="staff_id" />
  9. <result property="name" column="name" />
  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="deptId" column="dept_id" />
  16. <result property="approveStatus" column="approve_status" />
  17. <result property="deptName" column="dept_name" />
  18. </resultMap>
  19. <sql id="selectTStYearplanVo">
  20. select d.id, d.staff_id, d.name, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.approve_status ,s.dept_name from t_st_yearplan d
  21. left join sys_dept s on s.dept_id = d.dept_id
  22. </sql>
  23. <select id="selectTStYearplanList" parameterType="TStYearplan" resultMap="TStYearplanResult">
  24. <include refid="selectTStYearplanVo"/>
  25. <where>
  26. <if test="staffId != null and staffId != ''"> and staff_id = #{staffId}</if>
  27. <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
  28. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  29. <if test="createdate != null "> and createdate = #{createdate}</if>
  30. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  31. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  32. <if test="deptId != null "> and dept_id = #{deptId}</if>
  33. <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
  34. and d.del_flag = 0
  35. </where>
  36. <!-- 数据范围过滤 -->
  37. ${params.dataScope}
  38. </select>
  39. <select id="selectTStYearplanById" parameterType="Long" resultMap="TStYearplanResult">
  40. <include refid="selectTStYearplanVo"/>
  41. where id = #{id}
  42. </select>
  43. <insert id="insertTStYearplan" parameterType="TStYearplan">
  44. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  45. SELECT seq_t_st_yearplan.NEXTVAL as id FROM DUAL
  46. </selectKey>
  47. insert into t_st_yearplan
  48. <trim prefix="(" suffix=")" suffixOverrides=",">
  49. <if test="id != null">id,</if>
  50. <if test="staffId != null">staff_id,</if>
  51. <if test="name != null">name,</if>
  52. <if test="delFlag != null">del_flag,</if>
  53. <if test="createrCode != null">creater_code,</if>
  54. <if test="createdate != null">createdate,</if>
  55. <if test="updaterCode != null">updater_code,</if>
  56. <if test="updatedate != null">updatedate,</if>
  57. <if test="deptId != null">dept_id,</if>
  58. <if test="approveStatus != null">approve_status,</if>
  59. </trim>
  60. <trim prefix="values (" suffix=")" suffixOverrides=",">
  61. <if test="id != null">#{id},</if>
  62. <if test="staffId != null">#{staffId},</if>
  63. <if test="name != null">#{name},</if>
  64. <if test="delFlag != null">#{delFlag},</if>
  65. <if test="createrCode != null">#{createrCode},</if>
  66. <if test="createdate != null">#{createdate},</if>
  67. <if test="updaterCode != null">#{updaterCode},</if>
  68. <if test="updatedate != null">#{updatedate},</if>
  69. <if test="deptId != null">#{deptId},</if>
  70. <if test="approveStatus != null">#{approveStatus},</if>
  71. </trim>
  72. </insert>
  73. <update id="updateTStYearplan" parameterType="TStYearplan">
  74. update t_st_yearplan
  75. <trim prefix="SET" suffixOverrides=",">
  76. <if test="staffId != null">staff_id = #{staffId},</if>
  77. <if test="name != null">name = #{name},</if>
  78. <if test="delFlag != null">del_flag = #{delFlag},</if>
  79. <if test="createrCode != null">creater_code = #{createrCode},</if>
  80. <if test="createdate != null">createdate = #{createdate},</if>
  81. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  82. <if test="updatedate != null">updatedate = #{updatedate},</if>
  83. <if test="deptId != null">dept_id = #{deptId},</if>
  84. <if test="approveStatus != null">approve_status = #{approveStatus},</if>
  85. </trim>
  86. where id = #{id}
  87. </update>
  88. <update id="deleteTStYearplanById" parameterType="Long">
  89. update t_st_yearplan set del_flag = 2 where id = #{id}
  90. </update>
  91. <update id="deleteTStYearplanByIds" parameterType="String">
  92. update t_st_yearplan set del_flag = 2 where id in
  93. <foreach item="id" collection="array" open="(" separator="," close=")">
  94. #{id}
  95. </foreach>
  96. </update>
  97. </mapper>