fuliqi
2024-04-02 32b4f6188f32e6c08e813efa98a25d94eacdc0c6
ycl-server/src/main/resources/mapper/zgyw/CheckTemplateMapper.xml
@@ -1,109 +1,15 @@
<?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">
<?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.ycl.platform.mapper.CheckTemplateMapper">
    <resultMap type="com.ycl.platform.domain.entity.CheckTemplate" id="CheckTemplateResult">
        <result property="id"    column="id"    />
        <result property="templateName"    column="template_name"    />
        <result property="adjustCoefficient"    column="adjust_coefficient"    />
        <result property="adjustWay"    column="adjust_way"    />
        <result property="examineCategory"    column="examine_category"    />
        <result property="status"    column="status"    />
        <result property="deptId"    column="dept_id"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createUser"    column="create_user"    />
        <result property="createUserName"    column="create_user_name"    />
        <result property="updateUser"    column="update_user"    />
        <result property="updateUserName"    column="update_user_name"    />
        <result property="deleted"    column="deleted"    />
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.platform.domain.vo.CheckTemplateVO">
        <result column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="adjust_coefficient" property="adjustCoefficient" />
        <result column="adjust_way" property="adjustWay" />
        <result column="status" property="status" />
    </resultMap>
    <sql id="selectCheckTemplateVo">
        select id, template_name, adjust_coefficient, adjust_way, examine_category, status, dept_id, create_time, update_time, create_user, create_user_name, update_user, update_user_name, deleted from t_check_template
    </sql>
    <select id="selectCheckTemplateList" resultMap="CheckTemplateResult">
        <include refid="selectCheckTemplateVo"/>
        <where>
            <if test="templateName != null  and templateName != ''"> and template_name like concat('%', #{templateName}, '%')</if>
            <if test="adjustCoefficient != null "> and adjust_coefficient = #{adjustCoefficient}</if>
            <if test="adjustWay != null  and adjustWay != ''"> and adjust_way = #{adjustWay}</if>
            <if test="examineCategory != null "> and examine_category = #{examineCategory}</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
            <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
        </where>
    </select>
    <select id="selectCheckTemplateById" resultMap="CheckTemplateResult">
        <include refid="selectCheckTemplateVo"/>
        where id = #{id}
    </select>
    <insert id="insertCheckTemplate" useGeneratedKeys="true" keyProperty="id">
        insert into t_check_template
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="templateName != null and templateName != ''">template_name,</if>
            <if test="adjustCoefficient != null">adjust_coefficient,</if>
            <if test="adjustWay != null and adjustWay != ''">adjust_way,</if>
            <if test="examineCategory != null">examine_category,</if>
            <if test="status != null">status,</if>
            <if test="deptId != null">dept_id,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="createUser != null">create_user,</if>
            <if test="createUserName != null">create_user_name,</if>
            <if test="updateUser != null">update_user,</if>
            <if test="updateUserName != null">update_user_name,</if>
            <if test="deleted != null">deleted,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="templateName != null and templateName != ''">#{templateName},</if>
            <if test="adjustCoefficient != null">#{adjustCoefficient},</if>
            <if test="adjustWay != null and adjustWay != ''">#{adjustWay},</if>
            <if test="examineCategory != null">#{examineCategory},</if>
            <if test="status != null">#{status},</if>
            <if test="deptId != null">#{deptId},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="createUserName != null">#{createUserName},</if>
            <if test="updateUser != null">#{updateUser},</if>
            <if test="updateUserName != null">#{updateUserName},</if>
            <if test="deleted != null">#{deleted},</if>
         </trim>
    </insert>
    <update id="updateCheckTemplate">
        update t_check_template
        <trim prefix="SET" suffixOverrides=",">
            <if test="templateName != null and templateName != ''">template_name = #{templateName},</if>
            <if test="adjustCoefficient != null">adjust_coefficient = #{adjustCoefficient},</if>
            <if test="adjustWay != null and adjustWay != ''">adjust_way = #{adjustWay},</if>
            <if test="examineCategory != null">examine_category = #{examineCategory},</if>
            <if test="status != null">status = #{status},</if>
            <if test="deptId != null">dept_id = #{deptId},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="createUserName != null">create_user_name = #{createUserName},</if>
            <if test="updateUser != null">update_user = #{updateUser},</if>
            <if test="updateUserName != null">update_user_name = #{updateUserName},</if>
            <if test="deleted != null">deleted = #{deleted},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteCheckTemplateById" parameterType="Long">
        delete from t_check_template where id = #{id}
    </delete>
    <delete id="deleteCheckTemplateByIds" parameterType="String">
        delete from t_check_template where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
</mapper>