|
@@ -0,0 +1,280 @@
|
|
|
+<?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.jeeplus.modules.workmaterialcollect.dao.WorkMaterialCollectTotalDao">
|
|
|
+
|
|
|
+ <sql id="workMaterialCollectTotal">
|
|
|
+ a.id AS "id",
|
|
|
+ a.create_by AS "createBy.id",
|
|
|
+ a.create_date AS "createDate",
|
|
|
+ a.update_by AS "updateBy.id",
|
|
|
+ a.update_date AS "updateDate",
|
|
|
+ a.remarks AS "remarks",
|
|
|
+ a.del_flag AS "delFlag",
|
|
|
+ a.materialName AS "materialName",
|
|
|
+ a.specifications AS "specifications",
|
|
|
+ a.unit AS "unit",
|
|
|
+ a.describe AS "describe",
|
|
|
+ a.userTheParts AS "userTheParts",
|
|
|
+ a.category AS "category",
|
|
|
+ a.excludingTax AS "excludingTax",
|
|
|
+ a.projectSite AS "projectSite",
|
|
|
+ a.startDate AS "startDate",
|
|
|
+ a.endDate AS "endDate",
|
|
|
+ a.projectType AS "projectType",
|
|
|
+ a.projectPart AS "projectPart",
|
|
|
+ a.auditOpinion AS "auditOpinion",
|
|
|
+ a.projectName AS "projectName",
|
|
|
+ a.projectTypeId AS "projectTypeId"
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="get" resultType="com.jeeplus.modules.workmaterialcollect.entity.WorkMaterialCollectTotal" >
|
|
|
+ SELECT
|
|
|
+ <include refid="workMaterialCollectTotal"/>
|
|
|
+ FROM work_material_collect_total a
|
|
|
+ WHERE a.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findAllTypeTotal" resultType="com.jeeplus.modules.workmaterialcollect.entity.WorkMaterialCollectTotal">
|
|
|
+ SELECT
|
|
|
+ <include refid="workMaterialCollectTotal"/>
|
|
|
+ FROM work_material_collect_total a
|
|
|
+ where projectTypeId in
|
|
|
+ <foreach collection="list" item="item" open="(" close=")" separator=",">
|
|
|
+ #{item.id}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findList" resultType="com.jeeplus.modules.workmaterialcollect.entity.WorkMaterialCollectTotal" >
|
|
|
+ SELECT
|
|
|
+ <include refid="workMaterialCollectTotal"/>
|
|
|
+ FROM work_material_collect_total a
|
|
|
+ <where>
|
|
|
+ a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
+ <if test="materialName != null and materialName != ''">
|
|
|
+ AND a.materialName = #{materialName}
|
|
|
+ </if>
|
|
|
+ <if test="projectType != null and projectType != ''">
|
|
|
+ AND a.projectType = #{projectType}
|
|
|
+ </if>
|
|
|
+ <if test="projectPart != null and projectPart != ''">
|
|
|
+ AND a.projectPart = #{projectPart}
|
|
|
+ </if>
|
|
|
+ <if test="projectName != null and projectName != ''">
|
|
|
+ AND a.projectName = #{projectName}
|
|
|
+ </if>
|
|
|
+ <if test="projectSite != null and projectSite != ''">
|
|
|
+ AND a.projectSite = #{projectSite}
|
|
|
+ </if>
|
|
|
+ <if test="projectTypeId != null and projectTypeId != ''">
|
|
|
+ AND a.projectTypeId = #{projectTypeId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ORDER BY a.update_date DESC
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findListExcel" resultType="com.jeeplus.modules.workmaterialcollect.entity.WorkMaterialCollectExportTotal" >
|
|
|
+ SELECT
|
|
|
+ <include refid="workMaterialCollectTotal"/>
|
|
|
+ FROM work_material_collect_total a
|
|
|
+ <where>
|
|
|
+ a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
+ <if test="materialName != null and materialName != ''">
|
|
|
+ AND a.materialName = #{materialName}
|
|
|
+ </if>
|
|
|
+ <if test="projectType != null and projectType != ''">
|
|
|
+ AND a.projectType = #{projectType}
|
|
|
+ </if>
|
|
|
+ <if test="projectPart != null and projectPart != ''">
|
|
|
+ AND a.projectPart = #{projectPart}
|
|
|
+ </if>
|
|
|
+ <if test="projectName != null and projectName != ''">
|
|
|
+ AND a.projectName = #{projectName}
|
|
|
+ </if>
|
|
|
+ <if test="projectSite != null and projectSite != ''">
|
|
|
+ AND a.projectSite = #{projectSite}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ORDER BY a.update_date DESC
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findAllList" resultType="com.jeeplus.modules.workmaterialcollect.entity.WorkMaterialCollectTotal" >
|
|
|
+ SELECT
|
|
|
+ <include refid="workMaterialCollectTotal"/>
|
|
|
+ FROM work_material_collect_total a
|
|
|
+ <where>
|
|
|
+ a.del_flag = #{DEL_FLAG_NORMAL}
|
|
|
+ </where>
|
|
|
+ <choose>
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
+ ORDER BY ${page.orderBy}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ ORDER BY a.update_date DESC
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insert">
|
|
|
+ INSERT INTO work_material_collect_total(
|
|
|
+ id,
|
|
|
+ create_by,
|
|
|
+ create_date,
|
|
|
+ update_by,
|
|
|
+ update_date,
|
|
|
+ remarks,
|
|
|
+ del_flag,
|
|
|
+ materialName,
|
|
|
+ specifications,
|
|
|
+ unit,
|
|
|
+ describe,
|
|
|
+ userTheParts,
|
|
|
+ category,
|
|
|
+ excludingTax,
|
|
|
+ projectSite,
|
|
|
+ startDate,
|
|
|
+ endDate,
|
|
|
+ projectType,
|
|
|
+ projectPart,
|
|
|
+ auditOpinion,
|
|
|
+ projectName,
|
|
|
+ projectTypeId,
|
|
|
+ ) VALUES (
|
|
|
+ #{id},
|
|
|
+ #{createBy.id},
|
|
|
+ #{createDate},
|
|
|
+ #{updateBy.id},
|
|
|
+ #{updateDate},
|
|
|
+ #{remarks},
|
|
|
+ #{delFlag},
|
|
|
+ #{materialName},
|
|
|
+ #{specifications},
|
|
|
+ #{unit},
|
|
|
+ #{describe},
|
|
|
+ #{userTheParts},
|
|
|
+ #{category},
|
|
|
+ #{excludingTax},
|
|
|
+ #{projectSite},
|
|
|
+ #{startDate},
|
|
|
+ #{endDate},
|
|
|
+ #{projectType},
|
|
|
+ #{projectPart},
|
|
|
+ #{auditOpinion},
|
|
|
+ #{projectName},
|
|
|
+ #{projectTypeId}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertList">
|
|
|
+ replace INTO work_material_collect_total(
|
|
|
+ id,
|
|
|
+ create_by,
|
|
|
+ create_date,
|
|
|
+ update_by,
|
|
|
+ update_date,
|
|
|
+ remarks,
|
|
|
+ del_flag,
|
|
|
+ materialName,
|
|
|
+ specifications,
|
|
|
+ unit,
|
|
|
+ `describe`,
|
|
|
+ userTheParts,
|
|
|
+ category,
|
|
|
+ excludingTax,
|
|
|
+ projectSite,
|
|
|
+ startDate,
|
|
|
+ endDate,
|
|
|
+ projectType,
|
|
|
+ projectPart,
|
|
|
+ auditOpinion,
|
|
|
+ projectName,
|
|
|
+ projectTypeId
|
|
|
+ ) VALUES
|
|
|
+ <foreach collection="list" item="item" index="index" separator="," >
|
|
|
+ (
|
|
|
+ #{item.id},
|
|
|
+ #{item.createBy.id},
|
|
|
+ #{item.createDate},
|
|
|
+ #{item.updateBy.id},
|
|
|
+ #{item.updateDate},
|
|
|
+ #{item.remarks},
|
|
|
+ #{item.delFlag},
|
|
|
+ #{item.materialName},
|
|
|
+ #{item.specifications},
|
|
|
+ #{item.unit},
|
|
|
+ #{item.describe},
|
|
|
+ #{item.userTheParts},
|
|
|
+ #{item.category},
|
|
|
+ #{item.excludingTax},
|
|
|
+ #{item.projectSite},
|
|
|
+ #{item.startDate},
|
|
|
+ #{item.endDate},
|
|
|
+ #{item.projectType},
|
|
|
+ #{item.projectPart},
|
|
|
+ #{item.auditOpinion},
|
|
|
+ #{item.projectName},
|
|
|
+ #{item.projectTypeId}
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+
|
|
|
+ <update id="update">
|
|
|
+ UPDATE work_material_collect_total SET
|
|
|
+ update_by = #{updateBy.id},
|
|
|
+ update_date = #{updateDate},
|
|
|
+ remarks = #{remarks}
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+ <update id="updateRemarks">
|
|
|
+ UPDATE work_material_collect_total SET
|
|
|
+ remarks = #{remarks}
|
|
|
+ WHERE projectTypeId = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 批量删除确认单 -->
|
|
|
+ <delete id="deleteWorkTotal">
|
|
|
+ delete from work_material_collect_total where projectTypeId in
|
|
|
+ <foreach collection="list" item="item" index="no" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ <!--物理删除-->
|
|
|
+ <update id="delete">
|
|
|
+ DELETE FROM work_material_collect_total
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 根据工程id进行删除 -->
|
|
|
+ <delete id="deleteProjectTypeId">
|
|
|
+ DELETE FROM work_material_collect_total
|
|
|
+ WHERE projectTypeId = #{projectTypeId}
|
|
|
+ </delete>
|
|
|
+ <!--逻辑删除-->
|
|
|
+ <update id="deleteByLogic">
|
|
|
+ UPDATE work_material_collect_total SET
|
|
|
+ del_flag = #{DEL_FLAG_DELETE}
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
|
|
|
+ <select id="findUniqueByProperty" resultType="com.jeeplus.modules.workmaterialcollect.entity.WorkMaterialCollectTotal" statementType="STATEMENT">
|
|
|
+ select * FROM work_item where ${propertyName} = '${value}'
|
|
|
+ </select>
|
|
|
+</mapper>
|