cqdevicemgt/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltMonthInfoMapper.xml

64 lines
2.5 KiB
XML

<?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.bonus.sgzb.material.mapper.SltMonthInfoMapper">
<resultMap type="com.bonus.sgzb.material.domain.SltMonthInfo" id="BmAgreementInfoResult">
<result property="agreementId" column="agreement_id"/>
<result property="agreementCode" column="agreement_code"/>
<result property="unitId" column="unit_id"/>
<result property="unitName" column="unit_name"/>
<result property="projectId" column="project_id"/>
<result property="createBy" column="create_by"/>
<result property="contractCode" column="contract_code"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/>
<result property="leaseMoney" column="costs"/>
</resultMap>
<select id="getSltMonthInfo" resultType="com.bonus.sgzb.material.domain.SltMonthInfo">
SELECT
pmc.id,
bai.agreement_code as agreementCode,
bui.unit_name as unitName,
bp.lot_name as projectName,
pmc.`month` ,
pmc.costs as leaseMoney,
pmc.status,
pmc.cost_bearing_party as bearPart
FROM
project_month_costs pmc
LEFT JOIN bm_agreement_info bai on pmc.agreement_id = bai.agreement_id
LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
WHERE pmc.`month` =#{month}
<if test="unitId != null and unitId != ''">
and bai.unit_id = #{unitId}
</if>
<if test="projectId != null and projectId != ''">
and bai.project_id = #{projectId}
</if>
<if test="agreementCode != null and agreementCode != ''">
and bai.agreement_code = #{agreementCode}
</if>
</select>
<update id="auditSlt" >
<if test="dataCondition != null and dataCondition.size() > 0">
UPDATE project_month_costs
SET status = 1
WHERE id IN
<foreach collection="dataCondition" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</update>
</mapper>