ConstructionSignMapper.xml 5.96 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.business.mapper.ConstructionSignMapper">
    
    <resultMap type="ConstructionSign" id="ConstructionSignResult">
        <result property="id"    column="id"    />
        <result property="objectId"    column="object_id"    />
        <result property="workflowId"    column="workflow_id"    />
        <result property="createTime"    column="create_time"    />
        <result property="sign1"    column="sign1"    />
        <result property="sign2"    column="sign2"    />
        <result property="sign3"    column="sign3"    />
        <result property="sign4"    column="sign4"    />
        <result property="sign1Time"    column="sign1_time"    />
        <result property="sign2Time"    column="sign2_time"    />
        <result property="sign3Time"    column="sign3_time"    />
        <result property="sign4Time"    column="sign4_time"    />
        <result property="sign1Text"    column="sign1_text"    />
        <result property="sign2Text"    column="sign2_text"    />
        <result property="sign3Text"    column="sign3_text"    />
        <result property="sign4Text"    column="sign4_text"    />
    </resultMap>

    <sql id="selectConstructionSignVo">
        select id, object_id, workflow_id, create_time, sign1, sign2, sign3, sign4,sign1_time,sign2_time,sign3_time,sign4_time,sign1_text,sign2_text,sign3_text,sign4_text from construction_sign
    </sql>

    <select id="selectConstructionSignList" parameterType="ConstructionSign" resultMap="ConstructionSignResult">
        <include refid="selectConstructionSignVo"/>
        <where>  
            <if test="objectId != null  and objectId != ''"> and object_id = #{objectId}</if>
            <if test="workflowId != null  and workflowId != ''"> and workflow_id = #{workflowId}</if>
        </where>
    </select>
    
    <select id="selectConstructionSignById" parameterType="Long" resultMap="ConstructionSignResult">
        <include refid="selectConstructionSignVo"/>
        where id = #{id}
    </select>
        
            <select id="selectConstructionSignByObjId" parameterType="String" resultMap="ConstructionSignResult">
        <include refid="selectConstructionSignVo"/>
        where object_id = #{objectId}
    </select>
        
        
    <insert id="insertConstructionSign" parameterType="ConstructionSign" useGeneratedKeys="true" keyProperty="id">
        insert into construction_sign
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="objectId != null">object_id,</if>
            <if test="workflowId != null">workflow_id,</if>
            <if test="createTime != null">create_time,</if>
            <if test="sign1 != null">sign1,</if>
            <if test="sign2 != null">sign2,</if>
            <if test="sign3 != null">sign3,</if>
            <if test="sign4 != null">sign4,</if>
            <if test="sign1Time != null">sign1_time,</if>
            <if test="sign2Time != null">sign2_time,</if>
            <if test="sign3Time != null">sign3_time,</if>
            <if test="sign4Time != null">sign4_time,</if>
            <if test="sign1Text != null">sign1_text,</if>
            <if test="sign2Text != null">sign2_text,</if>
            <if test="sign3Text != null">sign3_text,</if>
            <if test="sign4Text != null">sign4_text,</if>
            
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="objectId != null">#{objectId},</if>
            <if test="workflowId != null">#{workflowId},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="sign1 != null">#{sign1},</if>
            <if test="sign2 != null">#{sign2},</if>
            <if test="sign3 != null">#{sign3},</if>
            <if test="sign4 != null">#{sign4},</if>
            <if test="sign1Time != null">#{sign1Time},</if>
            <if test="sign2Time != null">#{sign2Time},</if>
            <if test="sign3Time != null">#{sign3Time},</if>
            <if test="sign4Time != null">#{sign4Time},</if>
            <if test="sign1Text != null">#{sign1Text},</if>
            <if test="sign2Text != null">#{sign2Text},</if>
            <if test="sign3Text != null">#{sign3Text},</if>
            <if test="sign4Text != null">#{sign4Text},</if>
         </trim>
    </insert>

    <update id="updateConstructionSign" parameterType="ConstructionSign">
        update construction_sign
        <trim prefix="SET" suffixOverrides=",">
            <if test="objectId != null">object_id = #{objectId},</if>
            <if test="workflowId != null">workflow_id = #{workflowId},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="sign1 != null">sign1 = #{sign1},</if>
            <if test="sign2 != null">sign2 = #{sign2},</if>
            <if test="sign3 != null">sign3 = #{sign3},</if>
            <if test="sign4 != null">sign4 = #{sign4},</if>
            <if test="sign1Time != null">sign1_time = #{sign1Time},</if>
            <if test="sign2Time != null">sign2_time =#{sign2Time},</if>
            <if test="sign3Time != null">sign3_time =#{sign3Time},</if>
            <if test="sign4Time != null">sign4_time =#{sign4Time},</if>
            <if test="sign1Text != null">sign1_text = #{sign1Text},</if>
            <if test="sign2Text != null">sign2_text =#{sign2Text},</if>
            <if test="sign3Text != null">sign3_text =#{sign3Text},</if>
            <if test="sign4Text != null">sign4_text =#{sign4Text},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteConstructionSignById" parameterType="Long">
        delete from construction_sign where id = #{id}
    </delete>

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