123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- <?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.GoafChecklistMapper">
- <resultMap id="GoafChecklistDtoMapper" type="com.zhyc.xps.goaf.dto.GoafChecklistDto">
- <id column="checklist_id" property="checklistId" jdbcType="BIGINT"/>
- <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
- <result column="checklist_title" property="checklistTitle" jdbcType="VARCHAR"/>
- <result column="checklist_desc" property="checklistDesc" jdbcType="VARCHAR"/>
- <result column="checklist_item_id" property="checklistItemId" jdbcType="BIGINT"/>
- <result column="checklist_item_content" property="checklistItemContent" jdbcType="VARCHAR"/>
- </resultMap>
- <resultMap id="GoafChecklistMapper" type="com.zhyc.xps.goaf.entity.GoafChecklist">
- <id column="checklist_id" property="checklistId" jdbcType="BIGINT"/>
- <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
- <result column="checklist_title" property="checklistTitle" jdbcType="VARCHAR"/>
- <result column="checklist_desc" property="checklistDesc" jdbcType="VARCHAR"/>
- </resultMap>
- <select id="getChecklistByList" parameterType="java.util.Map" resultMap="GoafChecklistMapper">
- SELECT checklist_id,
- oc_id,
- checklist_title,
- checklist_desc
- FROM goaf_checklist
- WHERE oc_id = #{ocId, jdbcType=BIGINT}
- <if test="checklistId !=null">
- AND A.checklist_id = #{checklistId ,jdbcType=BIGINT}
- </if>
- <if test="checklistTitle !=null and checklistTitle != ''">
- AND A.checklist_title = #{checklistTitle ,jdbcType=VARCHAR}
- </if>
- </select>
- <!-- <select id="getByList" parameterType="java.util.Map" resultMap="GoafChecklistDtoMapper">-->
- <!-- SELECT A.checklist_id,-->
- <!-- A.oc_id,-->
- <!-- A.checklist_title,-->
- <!-- A.checklist_desc,-->
- <!-- B.checklist_item_id,-->
- <!-- B.checklist_item_content-->
- <!-- FROM goaf_checklist AS A-->
- <!-- left join goaf_checklist_item AS B ON B.checklist_id = A.checklist_id-->
- <!-- WHERE A.oc_id = #{ocId, jdbcType=BIGINT}-->
- <!-- <if test="checklistId !=null">-->
- <!-- AND A.checklist_id = #{checklistId ,jdbcType=BIGINT}-->
- <!-- </if>-->
- <!-- <if test="checklistTitle !=null and checklistTitle != ''">-->
- <!-- AND A.checklist_title = #{checklistTitle ,jdbcType=VARCHAR}-->
- <!-- </if>-->
- <!-- </select>-->
- <!--分页查询-->
- <select id="getChecklistByPage" parameterType="java.util.Map" resultMap="GoafChecklistMapper">
- SELECT checklist_id,
- oc_id,
- checklist_title,
- checklist_desc
- FROM goaf_checklist
- WHERE oc_id = #{ocId, jdbcType=BIGINT}
- <if test="checklistId !=null">
- AND A.checklist_id = #{checklistId ,jdbcType=BIGINT}
- </if>
- <if test="checklistTitle !=null and checklistTitle != ''">
- AND A.checklist_title = #{checklistTitle ,jdbcType=VARCHAR}
- </if>
- </select>
- <!-- <!–分页查询–>-->
- <!-- <select id="getByPage" parameterType="java.util.Map" resultMap="GoafChecklistDtoMapper">-->
- <!-- SELECT A.checklist_id,-->
- <!-- A.oc_id,-->
- <!-- A.checklist_title,-->
- <!-- A.checklist_desc,-->
- <!-- B.checklist_item_id,-->
- <!-- B.checklist_item_content-->
- <!-- FROM goaf_checklist AS A-->
- <!-- left join goaf_checklist_item AS B ON B.checklist_id = A.checklist_id-->
- <!-- WHERE A.oc_id = #{ocId, jdbcType=BIGINT}-->
- <!-- <if test="checklistId !=null">-->
- <!-- AND A.checklist_id = #{checklistId ,jdbcType=BIGINT}-->
- <!-- </if>-->
- <!-- <if test="checklistTitle !=null and checklistTitle != ''">-->
- <!-- AND A.checklist_title = #{checklistTitle ,jdbcType=VARCHAR}-->
- <!-- </if>-->
- <!-- </select>-->
- <!-- <select id="getById" resultMap="GoafChecklistDtoMapper">-->
- <!-- SELECT A.checklist_id,-->
- <!-- A.oc_id,-->
- <!-- A.checklist_title,-->
- <!-- A.checklist_desc,-->
- <!-- B.checklist_item_id,-->
- <!-- B.checklist_item_content-->
- <!-- FROM goaf_checklist AS A-->
- <!-- left join goaf_checklist_item AS B ON B.checklist_id = A.checklist_id-->
- <!-- WHERE A.checklist_id = #{checklistId ,jdbcType=BIGINT}-->
- <!-- </select>-->
- <insert id="create" parameterType="com.zhyc.xps.goaf.entity.GoafChecklist">
- insert into goaf_checklist
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="checklistId != null">
- checklist_id,
- </if>
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="checklistTitle != null and checklistTitle != ''">
- checklist_title,
- </if>
- <if test="checklistDesc != null and checklistDesc != ''">
- checklist_desc,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="checklistId != null">
- #{checklistId, jdbcType=BIGINT},
- </if>
- <if test="ocId != null">
- #{ocId, jdbcType=BIGINT},
- </if>
- <if test="checklistTitle != null and checklistTitle != ''">
- #{checklistTitle, jdbcType=VARCHAR},
- </if>
- <if test="checklistDesc != null and checklistDesc != ''">
- #{checklistDesc, jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <!--Update更新-->
- <update id="update" parameterType="com.zhyc.xps.goaf.entity.GoafChecklist">
- UPDATE goaf_checklist
- <trim suffixOverrides=",">
- <set>
- <if test="checklistTitle != null and checklistTitle != ''">
- checklist_title = #{checklistTitle, jdbcType=VARCHAR},
- </if>
- <if test="checklistDesc != null and checklistDesc != ''">
- checklist_desc = #{checklistDesc, jdbcType=VARCHAR},
- </if>
- </set>
- </trim>
- WHERE checklist_id = #{checklistId, jdbcType=BIGINT}
- </update>
- <delete id="delete" >
- DELETE FROM goaf_checklist
- WHERE checklist_id = #{checklistId, jdbcType=BIGINT}
- </delete>
- </mapper>
|