ProjectCheckMapper.xml 12.9 KB
<?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.trash.other.mapper.ProjectCheckMapper">
    
    <resultMap type="ProjectCheck" id="ProjectCheckResult">
        <result property="id"    column="id"    />
        <result property="type"    column="type"    />
        <result property="name"    column="name"    />
        <result property="timeLimit"    column="time_limit"    />
        <result property="checkTime"    column="check_time"    />
        <result property="projectType"    column="project_type"    />
        <result property="place"    column="place"    />
        <result property="address"    column="address"    />
        <result property="stock"    column="stock"    />
        <result property="checkPeople"    column="check_people"    />
        <result property="margin"    column="margin"    />
        <result property="createTime"    column="create_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="p1"    column="p1"    />
        <result property="p1C1"    column="p1_c1"    />
        <result property="p1C2"    column="p1_c2"    />
        <result property="p1C3"    column="p1_c3"    />
        <result property="p2"    column="p2"    />
        <result property="p2C1"    column="p2_c1"    />
        <result property="p2C2"    column="p2_c2"    />
        <result property="p2C3"    column="p2_c3"    />
        <result property="p3"    column="p3"    />
        <result property="p3C1"    column="p3_c1"    />
        <result property="p3C2"    column="p3_c2"    />
        <result property="p3C3"    column="p3_c3"    />
        <result property="p4"    column="p4"    />
        <result property="p4C1"    column="p4_c1"    />
        <result property="p4C2"    column="p4_c2"    />
        <result property="p5"    column="p5"    />
        <result property="p5C1"    column="p5_c1"    />
        <result property="p5C2"    column="p5_c2"    />
        <result property="p6"    column="p6"    />
        <result property="p6C1"    column="p6_c1"    />
        <result property="p6C2"    column="p6_c2"    />
        <result property="p7"    column="p7"    />
        <result property="p7C1"    column="p7_c1"    />
        <result property="p7C2"    column="p7_c2"    />
        <result property="p8"    column="p8"    />
        <result property="p8C1"    column="p8_c1"    />
        <result property="p8C2"    column="p8_c2"    />
        <result property="p9C1"    column="p9_c1"    />
        <result property="p9C2"    column="p9_c2"    />
        <result property="p9C3"    column="p9_c3"    />
        <result property="environment"    column="environment"    />
        <result property="line"    column="line"    />
        <result property="dest"    column="dest"    />
        <result property="checkSign"    column="check_sign"    />
        <result property="sign"    column="sign"    />
    </resultMap>

    <sql id="selectProjectCheckVo">
        select id, type, name, time_limit, check_time, project_type, stock,place,address, check_people, margin, create_time, create_by, p1, p1_c1, p1_c2, p1_c3, p2, p2_c1, p2_c2, p2_c3, p3, p3_c1, p3_c2, p3_c3, p4, p4_c1, p4_c2, p5, p5_c1, p5_c2, p6, p6_c1, p6_c2,  p7, p7_c1, p7_c2,  p8, p8_c1, p8_c2, p9_c1, p9_c2, p9_c3, environment, line, dest, check_sign, sign from project_check
    </sql>

    <select id="selectProjectCheckList" parameterType="ProjectCheck" resultMap="ProjectCheckResult">
        <include refid="selectProjectCheckVo"/>
        <where>  
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="place != null  and place != ''"> and place = #{place} </if>
            <if test="checkTime != null "> and check_time = #{checkTime}</if>
            <if test="projectType != null "> and project_type = #{projectType}</if>
            <if test="checkPeople != null  and checkPeople != ''"> and check_people = #{checkPeople}</if>
            <if test="margin != null "> and margin = #{margin}</if>
        </where>
    </select>
    
    <select id="selectProjectCheckById" parameterType="Long" resultMap="ProjectCheckResult">
        <include refid="selectProjectCheckVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertProjectCheck" parameterType="ProjectCheck" useGeneratedKeys="true" keyProperty="id">
        insert into project_check
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="type != null">type,</if>
            <if test="name != null">name,</if>
            <if test="timeLimit != null">time_limit,</if>
            <if test="checkTime != null">check_time,</if>
            <if test="projectType != null">project_type,</if>
            <if test="stock != null">stock,</if>
            <if test="place != null">place, </if>
            <if test="address != null">address, </if>
            <if test="checkPeople != null and checkPeople != ''">check_people,</if>
            <if test="margin != null">margin,</if>
            <if test="createTime != null">create_time,</if>
            <if test="createBy != null and createBy != ''">create_by,</if>
            <if test="p1 != null">p1,</if>
            <if test="p1C1 != null">p1_c1,</if>
            <if test="p1C2 != null">p1_c2,</if>
            <if test="p1C3 != null">p1_c3,</if>
            <if test="p2 != null">p2,</if>
            <if test="p2C1 != null">p2_c1,</if>
            <if test="p2C2 != null">p2_c2,</if>
            <if test="p2C3 != null">p2_c3,</if>
            <if test="p3 != null">p3,</if>
            <if test="p3C1 != null">p3_c1,</if>
            <if test="p3C2 != null">p3_c2,</if>
            <if test="p3C3 != null">p3_c3,</if>
            <if test="p4 != null">p4,</if>
            <if test="p4C1 != null">p4_c1,</if>
            <if test="p4C2 != null">p4_c2,</if>
            <if test="p5 != null">p5,</if>
            <if test="p5C1 != null">p5_c1,</if>
            <if test="p5C2 != null">p5_c2,</if>
            <if test="p6 != null">p6,</if>
            <if test="p6C1 != null">p6_c1,</if>
            <if test="p6C2 != null">p6_c2,</if>
            <if test="p7 != null">p7,</if>
            <if test="p7C1 != null">p7_c1,</if>
            <if test="p7C2 != null">p7_c2,</if>
            <if test="p8 != null">p8,</if>
            <if test="p8C1 != null">p8_c1,</if>
            <if test="p8C2 != null">p8_c2,</if>
            <if test="p9C1 != null">p9_c1,</if>
            <if test="p9C2 != null">p9_c2,</if>
            <if test="p9C3 != null">p9_c3,</if>
            <if test="environment != null and environment != ''">environment,</if>
            <if test="line != null and line != ''">line,</if>
            <if test="dest != null and dest != ''">dest,</if>
            <if test="checkSign != null and checkSign != ''">check_sign,</if>
            <if test="sign != null and sign != ''">sign,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="type != null">#{type},</if>
            <if test="name != null">#{name},</if>
            <if test="timeLimit != null">#{timeLimit},</if>
            <if test="checkTime != null">#{checkTime},</if>
            <if test="projectType != null">#{projectType},</if>
            <if test="stock != null">#{stock},</if>
            <if test="place != null">#{place}, </if>
            <if test="address != null">#{address}, </if>
            <if test="checkPeople != null and checkPeople != ''">#{checkPeople},</if>
            <if test="margin != null">#{margin},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="createBy != null and createBy != ''">#{createBy},</if>
            <if test="p1 != null">#{p1},</if>
            <if test="p1C1 != null">#{p1C1},</if>
            <if test="p1C2 != null">#{p1C2},</if>
            <if test="p1C3 != null">#{p1C3},</if>
            <if test="p2 != null">#{p2},</if>
            <if test="p2C1 != null">#{p2C1},</if>
            <if test="p2C2 != null">#{p2C2},</if>
            <if test="p2C3 != null">#{p2C3},</if>
            <if test="p3 != null">#{p3},</if>
            <if test="p3C1 != null">#{p3C1},</if>
            <if test="p3C2 != null">#{p3C2},</if>
            <if test="p3C3 != null">#{p3C3},</if>
            <if test="p4 != null">#{p4},</if>
            <if test="p4C1 != null">#{p4C1},</if>
            <if test="p4C2 != null">#{p4C2},</if>
            <if test="p5 != null">#{p5},</if>
            <if test="p5C1 != null">#{p5C1},</if>
            <if test="p5C2 != null">#{p5C2},</if>
            <if test="p6 != null">#{p6},</if>
            <if test="p6C1 != null">#{p6C1},</if>
            <if test="p6C2 != null">#{p6C2},</if>
            <if test="p7 != null">#{p7},</if>
            <if test="p7C1 != null">#{p7C1},</if>
            <if test="p7C2 != null">#{p7C2},</if>
            <if test="p8 != null">#{p8},</if>
            <if test="p8C1 != null">#{p8C1},</if>
            <if test="p8C2 != null">#{p8C2},</if>
            <if test="p9C1 != null">#{p9C1},</if>
            <if test="p9C2 != null">#{p9C2},</if>
            <if test="p9C3 != null">#{p9C3},</if>
            <if test="environment != null and environment != ''">#{environment},</if>
            <if test="line != null and line != ''">#{line},</if>
            <if test="dest != null and dest != ''">#{dest},</if>
            <if test="checkSign != null and checkSign != ''">#{checkSign},</if>
            <if test="sign != null and sign != ''">#{sign},</if>
         </trim>
    </insert>

    <update id="updateProjectCheck" parameterType="ProjectCheck">
        update project_check
        <trim prefix="SET" suffixOverrides=",">
            <if test="type != null">type = #{type},</if>
            <if test="name != null">name = #{name},</if>
            <if test="timeLimit != null">time_limit = #{timeLimit},</if>
            <if test="checkTime != null">check_time = #{checkTime},</if>
            <if test="projectType != null">project_type = #{projectType},</if>
            <if test="place != null">#{place}, </if>
            <if test="address != null">#{address}, </if>
            <if test="stock != null">stock = #{stock},</if>
            <if test="checkPeople != null and checkPeople != ''">check_people = #{checkPeople},</if>
            <if test="margin != null">margin = #{margin},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
            <if test="p1 != null">p1 = #{p1},</if>
            <if test="p1C1 != null">p1_c1 = #{p1C1},</if>
            <if test="p1C2 != null">p1_c2 = #{p1C2},</if>
            <if test="p1C3 != null">p1_c3 = #{p1C3},</if>
            <if test="p2 != null">p2 = #{p2},</if>
            <if test="p2C1 != null">p2_c1 = #{p2C1},</if>
            <if test="p2C2 != null">p2_c2 = #{p2C2},</if>
            <if test="p2C3 != null">p2_c3 = #{p2C3},</if>
            <if test="p3 != null">p3 = #{p3},</if>
            <if test="p3C1 != null">p3_c1 = #{p3C1},</if>
            <if test="p3C2 != null">p3_c2 = #{p3C2},</if>
            <if test="p3C3 != null">p3_c3 = #{p3C3},</if>
            <if test="p4 != null">p4 = #{p4},</if>
            <if test="p4C1 != null">p4_c1 = #{p4C1},</if>
            <if test="p4C2 != null">p4_c2 = #{p4C2},</if>
            <if test="p5 != null">p5 = #{p5},</if>
            <if test="p5C1 != null">p5_c1 = #{p5C1},</if>
            <if test="p5C2 != null">p5_c2 = #{p5C2},</if>
            <if test="p6 != null">p6 = #{p6},</if>
            <if test="p6C1 != null">p6_c1 = #{p6C1},</if>
            <if test="p6C2 != null">p6_c2 = #{p6C2},</if>
            <if test="p7 != null">p7 = #{p7},</if>
            <if test="p7C1 != null">p7_c1 = #{p7C1},</if>
            <if test="p7C2 != null">p7_c2 = #{p7C2},</if>
            <if test="p8 != null">p8 = #{p8},</if>
            <if test="p8C1 != null">p8_c1 = #{p8C1},</if>
            <if test="p8C2 != null">p8_c2 = #{p8C2},</if>
            <if test="p9C1 != null">p9_c1 = #{p9C1},</if>
            <if test="p9C2 != null">p9_c2 = #{p9C2},</if>
            <if test="p9C3 != null">p9_c3 = #{p9C3},</if>
            <if test="environment != null and environment != ''">environment = #{environment},</if>
            <if test="line != null and line != ''">line = #{line},</if>
            <if test="dest != null and dest != ''">dest = #{dest},</if>
            <if test="checkSign != null and checkSign != ''">check_sign = #{checkSign},</if>
            <if test="sign != null and sign != ''">sign = #{sign},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteProjectCheckById" parameterType="Long">
        delete from project_check where id = #{id}
    </delete>

    <delete id="deleteProjectCheckByIds" parameterType="String">
        delete from project_check where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    
</mapper>