123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ruoyi.project.training.spec.mapper.TStYearplanMapper">
- <resultMap type="TStYearplan" id="TStYearplanResult">
- <result property="id" column="id" />
- <result property="staffId" column="staff_id" />
- <result property="name" column="name" />
- <result property="delFlag" column="del_flag" />
- <result property="createrCode" column="creater_code" />
- <result property="createdate" column="createdate" />
- <result property="updaterCode" column="updater_code" />
- <result property="updatedate" column="updatedate" />
- <result property="deptId" column="dept_id" />
- <result property="approveStatus" column="approve_status" />
- <result property="deptName" column="dept_name" />
- </resultMap>
- <sql id="selectTStYearplanVo">
- 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
- left join sys_dept s on s.dept_id = d.dept_id
- </sql>
- <select id="selectTStYearplanList" parameterType="TStYearplan" resultMap="TStYearplanResult">
- <include refid="selectTStYearplanVo"/>
- <where>
- <if test="staffId != null and staffId != ''"> and staff_id = #{staffId}</if>
- <if test="name != null and name != ''"> and name like concat(concat('%', #{name}), '%')</if>
- <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
- <if test="createdate != null "> and createdate = #{createdate}</if>
- <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
- <if test="updatedate != null "> and updatedate = #{updatedate}</if>
- <if test="deptId != null "> and dept_id = #{deptId}</if>
- <if test="approveStatus != null "> and approve_status = #{approveStatus}</if>
- and d.del_flag = 0
- </where>
- <!-- 数据范围过滤 -->
- ${params.dataScope}
- </select>
- <select id="selectTStYearplanById" parameterType="Long" resultMap="TStYearplanResult">
- <include refid="selectTStYearplanVo"/>
- where id = #{id}
- </select>
- <insert id="insertTStYearplan" parameterType="TStYearplan">
- <selectKey keyProperty="id" resultType="long" order="BEFORE">
- SELECT seq_t_st_yearplan.NEXTVAL as id FROM DUAL
- </selectKey>
- insert into t_st_yearplan
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="staffId != null">staff_id,</if>
- <if test="name != null">name,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createrCode != null">creater_code,</if>
- <if test="createdate != null">createdate,</if>
- <if test="updaterCode != null">updater_code,</if>
- <if test="updatedate != null">updatedate,</if>
- <if test="deptId != null">dept_id,</if>
- <if test="approveStatus != null">approve_status,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="staffId != null">#{staffId},</if>
- <if test="name != null">#{name},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createrCode != null">#{createrCode},</if>
- <if test="createdate != null">#{createdate},</if>
- <if test="updaterCode != null">#{updaterCode},</if>
- <if test="updatedate != null">#{updatedate},</if>
- <if test="deptId != null">#{deptId},</if>
- <if test="approveStatus != null">#{approveStatus},</if>
- </trim>
- </insert>
- <update id="updateTStYearplan" parameterType="TStYearplan">
- update t_st_yearplan
- <trim prefix="SET" suffixOverrides=",">
- <if test="staffId != null">staff_id = #{staffId},</if>
- <if test="name != null">name = #{name},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createrCode != null">creater_code = #{createrCode},</if>
- <if test="createdate != null">createdate = #{createdate},</if>
- <if test="updaterCode != null">updater_code = #{updaterCode},</if>
- <if test="updatedate != null">updatedate = #{updatedate},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- <if test="approveStatus != null">approve_status = #{approveStatus},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="deleteTStYearplanById" parameterType="Long">
- update t_st_yearplan set del_flag = 2 where id = #{id}
- </update>
- <update id="deleteTStYearplanByIds" parameterType="String">
- update t_st_yearplan set del_flag = 2 where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </update>
- </mapper>
|