123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <?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.sealMaterial.dao.SealMaterialDao">
- <select id="selectCountAboutSealMaterial" resultType="integer">
- select count(1)
- from seal_material_info
- where seal_material_name = #{sealMaterialName}
- and amount = #{amount}
- and project_id = #{projectId}
- </select>
- <!--物理删除-->
- <delete id="delete">
- delete from seal_material_info
- WHERE id = #{id}
- </delete>
- <!-- 批量保存-->
- <insert id="batchInsert">
- insert into seal_material_info
- (id,
- create_by,
- create_date,
- update_by,
- update_date,
- remarks,
- del_flag,
- sort,
- seal_material_name,
- amount,
- main_contents,
- agent,
- seal_contents_remarks,
- project_id)
- values
- <foreach collection="sealMaterialInfoImportList" item="data" separator=",">
- (#{data.id},
- #{data.createBy.id},
- #{data.createDate},
- #{data.updateBy.id},
- #{data.updateDate},
- #{data.remarks},
- #{data.delFlag},
- #{data.sort},
- #{data.sealMaterialName},
- #{data.amount},
- #{data.mainContents},
- #{data.agent.id},
- #{data.sealMaterialImportRemarks},
- #{data.projectId})
- </foreach>
- </insert>
- <!--批量更新时间-->
- <update id="batchUpdateTime">
- update seal_material_info set
- use_seal_time = NOW()
- where project_id =#{projectId}
- </update>
- <select id="getSealMaterialByProjectId" resultType="com.jeeplus.modules.sealMaterial.entity.SealMaterialInfo">
- select
- r.project_name as "projectName",
- r.project_id as "reportId",
- s.seal_material_name as "sealMaterialName",
- s.amount as "amount",
- s.main_contents as "mainContents",
- r.area_name as "area",
- r.reviewer_person as "reviewPerson",
- (select s.name from rural_project_records r,sys_user s where r.create_by = s.id and r.id = #{projectId}) as "porjectCreatePerson",
- u.name as "projectMasterId",
- r.start_date as "startDate",
- r.ending_date as "endingDate",
- use_seal_time as "useSealTime",
- seal_contents_remarks as "sealMaterialImportRemarks",
- su.name as "agent.name",
- s.agent as "agent.id",
- s.id as "id"
- from seal_material_info s
- left join rural_project_records r on s.project_id = r.id
- left join sys_user u on r.project_master_id = u.id
- left join sys_user su on s.agent = su.id
- where s.project_id =#{projectId}
- order by s.sort asc
- </select>
- <select id="findExportList" resultType="com.jeeplus.modules.sealMaterial.entity.SealMaterialInfoExport">
- select
- s.seal_material_name as "sealMaterialName",
- s.amount as "amount",
- s.main_contents as "mainContents",
- u.name as "agentName",
- DATE_FORMAT(s.use_seal_time,'%Y-%m-%d') as "useSealTime",
- s.seal_contents_remarks as "sealMaterialImportRemarks",
- rpr.project_name as projectName,
- prd.number as projectReportNum
- from seal_material_info s
- left join sys_user u on s.agent = u.id
- left join rural_project_records rpr on rpr.id = s.project_id
- left join project_report_data prd on rpr.id = prd.project_id
- where s.project_id = #{projectId}
- order by s.sort asc
- </select>
- <select id="findExportAll" resultType="com.jeeplus.modules.sealMaterial.entity.SealMaterialInfoExport">
- select
- s.seal_material_name as "sealMaterialName",
- s.amount as "amount",
- s.main_contents as "mainContents",
- u.name as "agentName",
- DATE_FORMAT(s.use_seal_time,'%Y-%m-%d') as "useSealTime",
- s.seal_contents_remarks as "sealMaterialImportRemarks",
- rpr.project_name as projectName,
- prd.number as projectReportNum
- from seal_material_info s
- left join sys_user u on s.agent = u.id
- left join rural_project_records rpr on rpr.id = s.project_id
- left join project_report_data prd on rpr.id = prd.project_id
- <where>
- s.project_id in (select project_id from seal_apply_for_info where id in
- <foreach collection="idList" item="id" separator="," open="(" close=")">
- #{id}
- </foreach>
- )
- </where>
- order by prd.number desc,s.sort asc
- </select>
- <update id="updateById">
- update seal_material_info
- <if test="sealMaterialName!=null and sealMaterialName!=''">
- set seal_material_name = #{sealMaterialName}
- </if>
- <if test="amount!=null and amount!=''">
- ,amount = #{amount}
- </if>
- <if test="mainContents!=null and mainContents!=''">
- ,main_contents = #{mainContents}
- </if>
- <if test="sealMaterialImportRemarks!=null and sealMaterialImportRemarks!=''">
- ,seal_contents_remarks = #{sealMaterialImportRemarks}
- </if>
- where id =#{id}
- </update>
- <update id="deleteByProjectId">
- delete from seal_material_info where project_id = #{projectId}
- </update>
- </mapper>
|