协议接口优化
This commit is contained in:
parent
0992fa22d7
commit
da248081bc
|
|
@ -46,6 +46,11 @@ public class BmAgreementInfo extends BaseEntity
|
|||
@ApiModelProperty(value = "工程标段ID")
|
||||
private Long projectId;
|
||||
|
||||
/** 工程标段名称 */
|
||||
@Excel(name = "工程标段名称")
|
||||
@ApiModelProperty(value = "工程标段名称")
|
||||
private String projectName;
|
||||
|
||||
/** 租赁天数 */
|
||||
@Excel(name = "租赁天数")
|
||||
@ApiModelProperty(value = "租赁天数")
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="signTime" column="sign_time" />
|
||||
<result property="unitId" column="unit_id" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="project_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="leaseDay" column="lease_day" />
|
||||
<result property="planStartTime" column="plan_start_time" />
|
||||
|
|
@ -27,34 +28,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="isSlt" column="is_slt" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBmAgreementInfoVo">
|
||||
select agreement_id, agreement_code, sign_time, unit_id, project_id, create_by, lease_day, plan_start_time, contract_code, auth_person, phone, create_time, update_by, update_time, remark, company_id, file_name, file_url, status, protocol, is_slt from bm_agreement_info
|
||||
</sql>
|
||||
|
||||
<select id="selectBmAgreementInfoList" parameterType="com.bonus.material.basic.domain.BmAgreementInfo" resultMap="BmAgreementInfoResult">
|
||||
<include refid="selectBmAgreementInfoVo"/>
|
||||
<where>
|
||||
<if test="agreementCode != null and agreementCode != ''"> and agreement_code = #{agreementCode}</if>
|
||||
<if test="signTime != null "> and sign_time = #{signTime}</if>
|
||||
<if test="unitId != null "> and unit_id = #{unitId}</if>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="leaseDay != null "> and lease_day = #{leaseDay}</if>
|
||||
<if test="planStartTime != null "> and plan_start_time = #{planStartTime}</if>
|
||||
<if test="contractCode != null and contractCode != ''"> and contract_code = #{contractCode}</if>
|
||||
<if test="authPerson != null and authPerson != ''"> and auth_person = #{authPerson}</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="companyId != null "> and company_id = #{companyId}</if>
|
||||
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||||
<if test="fileUrl != null and fileUrl != ''"> and file_url = #{fileUrl}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="protocol != null and protocol != ''"> and protocol = #{protocol}</if>
|
||||
<if test="isSlt != null "> and is_slt = #{isSlt}</if>
|
||||
</where>
|
||||
SELECT bai.agreement_id, bai.agreement_code , contract_code,file_url ,file_name,sign_time,
|
||||
bu.unit_id,bu.unit_name , bp.pro_id as projectId , bp.pro_name as projectName,
|
||||
plan_start_time,lease_day,auth_person,phone,bai.remark,bai.protocol
|
||||
FROM bm_agreement_info bai
|
||||
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
|
||||
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
|
||||
where bai.status = '1'
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (bai.contract_code like concat('%', #{keyWord}, '%') or
|
||||
auth_person like concat('%', #{keyWord}, '%') or
|
||||
phone like concat('%', #{keyWord}, '%'))
|
||||
</if>
|
||||
|
||||
<if test="agreementCode != null and agreementCode != ''">
|
||||
and bai.agreement_code like concat('%', #{agreementCode}, '%')
|
||||
</if>
|
||||
<if test="unitId != null and unitId != ''">
|
||||
and bu.unit_id = #{unitId}
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and bp.pro_id = #{projectId}
|
||||
</if>
|
||||
<if test="dataCondition != null and dataCondition.size()>0">
|
||||
AND bai.agreement_id in
|
||||
<foreach collection="dataCondition" item="agreementId" index="index" open="(" separator="," close=")">
|
||||
#{agreementId}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY bai.agreement_id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectBmAgreementInfoByAgreementId" parameterType="Long" resultMap="BmAgreementInfoResult">
|
||||
<include refid="selectBmAgreementInfoVo"/>
|
||||
where agreement_id = #{agreementId}
|
||||
SELECT bai.agreement_id, bai.agreement_code , contract_code,file_url ,file_name,sign_time,
|
||||
bu.unit_id,bu.unit_name , bp.pro_id as projectId , bp.pro_name as projectName,
|
||||
plan_start_time,lease_day,auth_person,phone,bai.remark,bai.protocol
|
||||
FROM bm_agreement_info bai
|
||||
LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id
|
||||
LEFT JOIN bm_unit bu ON bu.unit_id = bai.unit_id
|
||||
where bai.status = '1' and agreement_id = #{agreementId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBmAgreementInfo" parameterType="com.bonus.material.basic.domain.BmAgreementInfo" useGeneratedKeys="true" keyProperty="agreementId">
|
||||
|
|
|
|||
Loading…
Reference in New Issue