119 lines
4.0 KiB
XML
119 lines
4.0 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.WorkSiteDirectManageMapper">
|
|
<insert id="saveDirectApplyInfo" parameterType="com.bonus.sgzb.base.api.domain.DirectApplyInfo" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
|
|
insert into direct_apply_info
|
|
(
|
|
<if test="code != null and code != ''">
|
|
code,
|
|
</if>
|
|
<if test="backAgreementId != null">
|
|
back_agreement_id,
|
|
</if>
|
|
<if test="backMan != null and backMan != ''">
|
|
back_man,
|
|
</if>
|
|
<if test="backPhone != null and backPhone != ''">
|
|
back_phone,
|
|
</if>
|
|
<if test="backRemark != null and backRemark != ''">
|
|
back_remark,
|
|
</if>
|
|
<if test="leaseAgreementId != null">
|
|
lease_agreement_id,
|
|
</if>
|
|
<if test="leaseMan != null and leaseMan != ''">
|
|
lease_man,
|
|
</if>
|
|
<if test="leasePhone != null and leasePhone != ''">
|
|
lease_phone,
|
|
</if>
|
|
<if test="dirUrl != null and dirUrl != ''">
|
|
dir_url,
|
|
</if>
|
|
<if test="status != null and status != ''">
|
|
status,
|
|
</if>
|
|
<if test="auditor != null and auditor != ''">
|
|
auditor,
|
|
</if>
|
|
<if test="auditTime != null and auditTime != ''">
|
|
audit_time,
|
|
</if>
|
|
<if test="auditRemark != null and auditRemark != ''">
|
|
audit_remark,
|
|
</if>
|
|
create_time
|
|
) values (
|
|
<if test="code != null and code != ''">
|
|
#{code},
|
|
</if>
|
|
<if test="backAgreementId != null">
|
|
#{backAgreementId},
|
|
</if>
|
|
<if test="backMan != null and backMan != ''">
|
|
#{backMan},
|
|
</if>
|
|
<if test="backPhone != null and backPhone != ''">
|
|
#{backPhone},
|
|
</if>
|
|
<if test="backRemark != null and backRemark != ''">
|
|
#{backRemark},
|
|
</if>
|
|
<if test="leaseAgreementId != null">
|
|
#{leaseAgreementId},
|
|
</if>
|
|
<if test="leaseMan != null and leaseMan != ''">
|
|
#{leaseMan},
|
|
</if>
|
|
<if test="leasePhone != null and leasePhone != ''">
|
|
#{leasePhone},
|
|
</if>
|
|
<if test="dirUrl != null and dirUrl != ''">
|
|
#{dirUrl},
|
|
</if>
|
|
<if test="status != null and status != ''">
|
|
#{status},
|
|
</if>
|
|
<if test="auditor != null and auditor != ''">
|
|
#{auditor},
|
|
</if>
|
|
<if test="auditTime != null and auditTime != ''">
|
|
#{auditTime},
|
|
</if>
|
|
<if test="auditRemark != null and auditRemark != ''">
|
|
#{auditRemark},
|
|
</if>
|
|
NOW()
|
|
)
|
|
</insert>
|
|
<insert id="saveDirectApplyDetails" parameterType="com.bonus.sgzb.base.api.domain.DirectApplyDetails">
|
|
insert into direct_apply_info(direct_id,type_id,ma_id,direct_num)
|
|
values (#{directId},#{typeId},#{maId}, #{directNum})
|
|
</insert>
|
|
<update id="refuseDirectApplyInfo">
|
|
update direct_apply_info set status = #{status} where id = #{id}
|
|
</update>
|
|
|
|
<select id="getUseringData" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
|
|
SELECT
|
|
sai.*,
|
|
mt.type_name AS typeModelName,
|
|
mt2.type_name AS typeName,
|
|
mm.ma_code AS maCode,
|
|
sum(sai.num) AS useNum
|
|
FROM
|
|
slt_agreement_info sai
|
|
LEFT JOIN ma_type mt on sai.type_id = mt.type_id
|
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
|
LEFT JOIN ma_machine mm on sai.ma_id = mm.ma_id
|
|
where sai.agreement_id = #{agreementId} and sai.status = '0'
|
|
GROUP BY
|
|
sai.type_id,sai.ma_id
|
|
</select>
|
|
<select id="getList" resultType="com.bonus.sgzb.base.api.domain.DirectApplyInfo">
|
|
select * from direct_apply_info
|
|
</select>
|
|
</mapper> |