123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <?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.zhyc.xps.sys.mapper.TaskCatMapper">
- <resultMap id="TaskCatDtoResultMap" type="com.zhyc.xps.sys.dto.TaskCatDto">
- <result column="task_cat_id" property="taskCatId" jdbcType="BIGINT"/>
- <result column="task_cat_title" property="taskCatTitle" jdbcType="VARCHAR"/>
- <result column="task_cat_desc" property="taskCatDesc" jdbcType="VARCHAR"/>
- <result column="is_fixed" property="isFixed" jdbcType="BIGINT"/>
- </resultMap>
- <sql id="TaskCatDto_Cols">
- task_cat_id,
- task_cat_title,
- task_cat_desc,
- is_fixed
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="TaskCatDtoResultMap">
- SELECT
- <include refid="TaskCatDto_Cols"/>
- FROM task_cat
- WHERE 1 = 1
- <if test="taskCatId != null">
- AND task_cat_id = #{taskCatId ,jdbcType=BIGINT}
- </if>
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="TaskCatDtoResultMap">
- SELECT
- <include refid="TaskCatDto_Cols"/>
- FROM task_cat
- WHERE deleted_flag = 0
- <if test="keywords != null and keywords != ''">
- AND task_cat_title like "%"#{keywords}"%"
- </if>
- ORDER BY task_cat_id ASC
- </select>
- <!--列表查询-->
- <select id="getByList" parameterType="java.util.Map" resultMap="TaskCatDtoResultMap">
- SELECT
- <include refid="TaskCatDto_Cols"/>
- FROM task_cat
- WHERE deleted_flag = 0
- <if test="keywords != null and keywords != ''">
- AND task_cat_title like "%"#{keywords}"%"
- </if>
- </select>
- <!--新增Create-->
- <insert id="create" parameterType="com.zhyc.xps.sys.entity.TaskCat">
- INSERT INTO task_cat
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="taskCatId != null">
- task_cat_id,
- </if>
- <if test="taskCatTitle != null and taskCatTitle != ''">
- task_cat_title,
- </if>
- <if test="taskCatDesc != null and taskCatDesc != ''">
- task_cat_desc,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- #{ocId ,jdbcType=BIGINT},
- </if>
- <if test="taskCatId != null">
- #{taskCatId ,jdbcType=BIGINT},
- </if>
- <if test="taskCatTitle != null and taskCatTitle != ''">
- #{taskCatTitle ,jdbcType=VARCHAR},
- </if>
- <if test="taskCatDesc != null and taskCatDesc != ''">
- #{taskCatDesc ,jdbcType=VARCHAR},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--更新-->
- <update id="update" parameterType="com.zhyc.xps.sys.entity.TaskCat">
- UPDATE task_cat
- <trim suffixOverrides=",">
- <set>
- <if test="taskCatTitle != null and taskCatTitle != ''">
- task_cat_title = #{taskCatTitle, jdbcType=VARCHAR},
- </if>
- <if test="taskCatDesc != null and taskCatDesc != ''">
- task_cat_desc = #{taskCatDesc, jdbcType=VARCHAR},
- </if>
- <if test="updatedBy != null ">
- updated_by = #{updatedBy ,jdbcType=BIGINT},
- </if>
- <if test="updatedAt != null">
- updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
- </if>
- </set>
- </trim>
- WHERE oc_id = #{ocId ,jdbcType=BIGINT}
- AND task_cat_id = #{taskCatId ,jdbcType=BIGINT}
- </update>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE task_cat
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag,jdbcType=BIGINT},
- </if>
- <if test="deletedTime != null">
- deleted_time = #{deletedTime,jdbcType=VARCHAR},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE oc_id = #{ocId ,jdbcType=BIGINT}
- AND task_cat_id = #{taskCatId ,jdbcType=BIGINT}
- </update>
- </mapper>
|