12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?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.goaf.mapper.GoafChecklistItemMapper">
- <resultMap id="GoafChecklistItemMapper" type="com.zhyc.xps.goaf.entity.GoafChecklistItem">
- <id column="checklist_item_id" property="checklistItemId" jdbcType="BIGINT"/>
- <result column="checklist_id" property="checklistId" jdbcType="BIGINT"/>
- <result column="checklist_item_content" property="checklistItemContent" jdbcType="VARCHAR"/>
- </resultMap>
- <select id="getChecklistItemById" resultMap="GoafChecklistItemMapper">
- SELECT checklist_item_id,
- checklist_item_content
- FROM goaf_checklist_item
- WHERE checklist_id = #{checklistId ,jdbcType=BIGINT}
- </select>
-
- <insert id="create" parameterType="com.zhyc.xps.goaf.entity.GoafChecklistItem">
- insert into goaf_checklist_item
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="checklistItemId != null">
- checklist_item_id,
- </if>
- <if test="checklistId != null">
- checklist_id,
- </if>
- <if test="checklistItemContent != null and checklistItemContent != ''">
- checklist_item_content,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="checklistItemId != null">
- #{checklistItemId, jdbcType=BIGINT},
- </if>
- <if test="checklistId != null">
- #{checklistId, jdbcType=BIGINT},
- </if>
- <if test="checklistItemContent != null and checklistItemContent != ''">
- #{checklistItemContent, jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <!--Update更新-->
- <update id="update" parameterType="com.zhyc.xps.goaf.entity.GoafChecklistItem">
- UPDATE goaf_checklist_item
- <trim suffixOverrides=",">
- <set>
- <if test="checklistItemContent != null and checklistItemContent != ''">
- checklist_item_content = #{checklistItemContent, jdbcType=VARCHAR},
- </if>
- </set>
- </trim>
- WHERE checklist_item_id = #{checklistItemId, jdbcType=BIGINT}
- </update>
- <delete id="delete" >
- DELETE FROM goaf_checklist_item
- WHERE checklist_item_id = #{checklistItemId, jdbcType=BIGINT, jdbcType=BIGINT}
- </delete>
- <delete id="deleteAll" >
- DELETE FROM goaf_checklist_item
- WHERE checklist_id = #{checklistId, jdbcType=BIGINT, jdbcType=BIGINT}
- </delete>
- </mapper>
|