|
@@ -1,61 +1,96 @@
|
|
|
<?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.ym.mec.biz.dal.dao.InspectionItemPlanConclusionDao">
|
|
|
- <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion">
|
|
|
- <!--@mbg.generated-->
|
|
|
- <!--@Table inspection_item_plan_conclusion-->
|
|
|
- <id column="id_" property="id" />
|
|
|
- <result column="plan_id_" property="planId" />
|
|
|
- <result column="teacher_id_" property="teacherId" />
|
|
|
- <result column="check_item_" property="checkItem" />
|
|
|
- <result column="check_conclusion_" property="checkConclusion" />
|
|
|
- <result column="create_time_" property="createTime" />
|
|
|
- <result column="update_time_" property="updateTime" />
|
|
|
- </resultMap>
|
|
|
- <sql id="Base_Column_List">
|
|
|
- <!--@mbg.generated-->
|
|
|
- id_, plan_id_, teacher_id_, check_item_, check_conclusion_, create_time_, update_time_
|
|
|
- </sql>
|
|
|
- <select id="get" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
- <!--@mbg.generated-->
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from inspection_item_plan_conclusion
|
|
|
- where id_ = #{id}
|
|
|
- </select>
|
|
|
- <delete id="delete" parameterType="java.lang.Integer">
|
|
|
- <!--@mbg.generated-->
|
|
|
- delete from inspection_item_plan_conclusion
|
|
|
- where id_ = #{id}
|
|
|
- </delete>
|
|
|
- <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion" useGeneratedKeys="true">
|
|
|
- <!--@mbg.generated-->
|
|
|
- insert into inspection_item_plan_conclusion (plan_id_, teacher_id_,check_item_, check_conclusion_, create_time_, update_time_)
|
|
|
- values (#{planId}, #{teacherId}, #{checkItem}, #{checkConclusion},#{createTime}, #{updateTime})
|
|
|
- </insert>
|
|
|
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion">
|
|
|
- <!--@mbg.generated-->
|
|
|
- update inspection_item_plan_conclusion
|
|
|
- <set>
|
|
|
- <if test="planId != null">
|
|
|
- plan_id_ = #{planId},
|
|
|
- </if>
|
|
|
- <if test="teacherId != null">
|
|
|
- teacher_id_ = #{teacherId},
|
|
|
- </if>
|
|
|
- <if test="checkItem != null">
|
|
|
- check_item_ = #{checkItem},
|
|
|
- </if>
|
|
|
- <if test="checkConclusion != null">
|
|
|
- check_conclusion_ = #{checkConclusion},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time_ = #{createTime},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">
|
|
|
- update_time_ = #{updateTime},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id_ = #{id}
|
|
|
- </update>
|
|
|
+ <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ <!--@Table inspection_item_plan_conclusion-->
|
|
|
+ <id column="id_" property="id"/>
|
|
|
+ <result column="plan_id_" property="planId"/>
|
|
|
+ <result column="teacher_id_" property="teacherId"/>
|
|
|
+ <result column="check_item_" property="checkItem"/>
|
|
|
+ <result column="check_conclusion_" property="checkConclusion"/>
|
|
|
+ <result column="create_time_" property="createTime"/>
|
|
|
+ <result column="update_time_" property="updateTime"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ id_, plan_id_, teacher_id_, check_item_, check_conclusion_, create_time_, update_time_
|
|
|
+ </sql>
|
|
|
+ <select id="get" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from inspection_item_plan_conclusion
|
|
|
+ where id_ = #{id}
|
|
|
+ </select>
|
|
|
+ <delete id="delete" parameterType="java.lang.Integer">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ delete from inspection_item_plan_conclusion
|
|
|
+ where id_ = #{id}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" keyColumn="id_" keyProperty="id"
|
|
|
+ parameterType="com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion" useGeneratedKeys="true">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into inspection_item_plan_conclusion (plan_id_, teacher_id_,check_item_, check_conclusion_, create_time_,
|
|
|
+ update_time_)
|
|
|
+ values (#{planId}, #{teacherId}, #{checkItem}, #{checkConclusion},#{createTime}, #{updateTime})
|
|
|
+ </insert>
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ update inspection_item_plan_conclusion
|
|
|
+ <set>
|
|
|
+ <if test="planId != null">
|
|
|
+ plan_id_ = #{planId},
|
|
|
+ </if>
|
|
|
+ <if test="teacherId != null">
|
|
|
+ teacher_id_ = #{teacherId},
|
|
|
+ </if>
|
|
|
+ <if test="checkItem != null">
|
|
|
+ check_item_ = #{checkItem},
|
|
|
+ </if>
|
|
|
+ <if test="checkConclusion != null">
|
|
|
+ check_conclusion_ = #{checkConclusion},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time_ = #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time_ = #{updateTime},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id_ = #{id}
|
|
|
+ </update>
|
|
|
+ <delete id="delByPlanIdAndCheckItem">
|
|
|
+ DELETE
|
|
|
+ FROM inspection_item_plan_conclusion
|
|
|
+ WHERE plan_id_ = #{planId}
|
|
|
+ ANd check_item_ = #{checkItem}
|
|
|
+ </delete>
|
|
|
+ <insert id="batchAdd" keyColumn="id_" keyProperty="id"
|
|
|
+ parameterType="com.ym.mec.biz.dal.entity.InspectionItemPlanConclusion"
|
|
|
+ useGeneratedKeys="true">
|
|
|
+ INSERT INTO inspection_item_plan_conclusion (plan_id_, teacher_id_, check_item_, check_conclusion_,
|
|
|
+ create_time_,update_time_)
|
|
|
+ VALUE
|
|
|
+ <foreach collection="inspectionItemPlanConclusions" item="inspectionItemPlanConclusion" separator=",">
|
|
|
+ (#{inspectionItemPlanConclusion.planId}, #{inspectionItemPlanConclusion.teacherId},
|
|
|
+ #{inspectionItemPlanConclusion.checkItem},
|
|
|
+ #{inspectionItemPlanConclusion.checkConclusion}, #{inspectionItemPlanConclusion.createTime},
|
|
|
+ #{inspectionItemPlanConclusion.updateTime})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <select id="getLastCheckItem" resultType="com.ym.mec.biz.dal.dto.CheckItemDto">
|
|
|
+ SELECT plan_id_ planId,MAX(check_item_) checkItem FROM inspection_item_plan_conclusion WHERE plan_id_ IN
|
|
|
+ <foreach collection="planIds" item="planId" open="(" close=")" separator=",">
|
|
|
+ #{planId}
|
|
|
+ </foreach>
|
|
|
+ GROUP BY plan_id_
|
|
|
+ </select>
|
|
|
+ <select id="getInspectionItemPlanConclusion" resultMap="BaseResultMap">
|
|
|
+ SELECT * FROM inspection_item_plan_conclusion WHERE plan_id_=#{planId}
|
|
|
+ <if test="checkItem != null">
|
|
|
+ AND check_item_ = #{checkItem}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|