|
|
|
@ -24,27 +24,6 @@
|
|
|
|
|
<result property="remark" column="remark"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<resultMap type="com.ruoyi.jjh.declaration.entity.vo.BmsDeclarationRecordsQueryVo"
|
|
|
|
|
id="BmsDeclarationRecordsVoResult">
|
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
|
<result property="jjhProjectId" column="jjh_project_id"/>
|
|
|
|
|
<result property="projectName" column="project_name"/>
|
|
|
|
|
<result property="projectId" column="project_id"/>
|
|
|
|
|
<result property="enterpriseId" column="enterprise_id"/>
|
|
|
|
|
<result property="level" column="level"/>
|
|
|
|
|
<result property="year" column="year"/>
|
|
|
|
|
<result property="type" column="type"/>
|
|
|
|
|
<result property="road" column="road"/>
|
|
|
|
|
<result property="responsibilityUnit" column="responsibility_unit"/>
|
|
|
|
|
<result property="templateId" column="template_id"/>
|
|
|
|
|
<result property="creditCode" column="credit_code"/>
|
|
|
|
|
<result property="templateRecordId" column="template_record_id"/>
|
|
|
|
|
<result property="detailId" column="detail_id"/>
|
|
|
|
|
<result property="status" column="status"/>
|
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
|
<result property="enterpriseName" column="enterprise_name"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectBmsDeclarationRecordsVo">
|
|
|
|
|
select id,
|
|
|
|
@ -55,67 +34,7 @@
|
|
|
|
|
from bms_declaration_records
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectBmsDeclarationRecordsList" parameterType="com.ruoyi.jjh.declaration.entity.dto.BmsDeclarationRecordsDto"
|
|
|
|
|
resultMap="BmsDeclarationRecordsVoResult">
|
|
|
|
|
SELECT
|
|
|
|
|
a.id,
|
|
|
|
|
a.jjh_project_id,
|
|
|
|
|
a.project_id,
|
|
|
|
|
a.credit_code,
|
|
|
|
|
a.enterprise_id,
|
|
|
|
|
c.LEVEL,
|
|
|
|
|
a.YEAR,
|
|
|
|
|
c.type,
|
|
|
|
|
a.template_record_id,
|
|
|
|
|
a.template_id,
|
|
|
|
|
c.responsibility_unit,
|
|
|
|
|
a.detail_id,
|
|
|
|
|
a.STATUS,
|
|
|
|
|
a.is_deleted,
|
|
|
|
|
a.create_by,
|
|
|
|
|
a.create_time,
|
|
|
|
|
a.update_by,
|
|
|
|
|
a.update_time,
|
|
|
|
|
a.remark,
|
|
|
|
|
b.qymc as enterpriseName,
|
|
|
|
|
f.road,
|
|
|
|
|
f.enterprise_directory
|
|
|
|
|
FROM
|
|
|
|
|
bms_declaration_records AS a
|
|
|
|
|
inner join bms_template_record f on a.template_record_id = f.id
|
|
|
|
|
LEFT JOIN bms_template_info c on a.template_id = c.id
|
|
|
|
|
LEFT JOIN bms_enterprise_basic_info b ON a.credit_code = b.tyshxydm
|
|
|
|
|
left join sys_dict_data e on a.status = e.dict_value and e.dict_type='bms_approval_status'
|
|
|
|
|
<where>
|
|
|
|
|
<if test="enterpriseDirectory != null and enterpriseDirectory != ''">and f.enterprise_directory like
|
|
|
|
|
concat('%', #{enterpriseDirectory},
|
|
|
|
|
'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="templateName != null and templateName != ''">and c.template_name like concat('%',
|
|
|
|
|
#{templateName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="creditCode != null ">and a.credit_code = #{creditCode}</if>
|
|
|
|
|
<if test="enterpriseId != null ">and a.enterprise_id = #{enterpriseId}</if>
|
|
|
|
|
<if test="level != null ">and c.level = #{level}</if>
|
|
|
|
|
<if test="year != null and year != ''">and year = #{year}</if>
|
|
|
|
|
<if test="responsibilityUnit != null ">and c.responsibility_unit = #{responsibilityUnit}</if>
|
|
|
|
|
<if test="status != null ">and a.status = #{status}</if>
|
|
|
|
|
<if test="statusStr != null and statusStr.size>0">
|
|
|
|
|
and a.status in
|
|
|
|
|
<foreach collection="statusStr" item="item" separator="," open="(" close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="statusChange == 0">
|
|
|
|
|
and a.status in (0,10)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="statusChange == 1">
|
|
|
|
|
and a.status not in (0,10)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="isDeleted != null ">and a.is_deleted = #{isDeleted}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by FIELD(a.status, 0, 1, 2, 3,10,8,7,9,5),a.create_time desc, e.dict_sort desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectBmsDeclarationRecordsById" parameterType="Long" resultMap="BmsDeclarationRecordsResult">
|
|
|
|
|
<include refid="selectBmsDeclarationRecordsVo"/>
|
|
|
|
@ -304,6 +223,67 @@
|
|
|
|
|
left join bms_template_record f on a.template_record_id = f.id
|
|
|
|
|
where f.status != 3 and a.status = 0
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectBmsDeclarationRecordsList"
|
|
|
|
|
resultType="com.ruoyi.jjh.declaration.entity.vo.BmsDeclarationRecordsQueryVo">
|
|
|
|
|
SELECT
|
|
|
|
|
a.id,
|
|
|
|
|
a.jjh_project_id,
|
|
|
|
|
a.project_id,
|
|
|
|
|
a.credit_code,
|
|
|
|
|
b.id as enterpriseId,
|
|
|
|
|
c.LEVEL,
|
|
|
|
|
a.YEAR,
|
|
|
|
|
c.type,
|
|
|
|
|
a.template_record_id,
|
|
|
|
|
a.template_id,
|
|
|
|
|
c.responsibility_unit,
|
|
|
|
|
a.detail_id,
|
|
|
|
|
a.STATUS,
|
|
|
|
|
a.is_deleted,
|
|
|
|
|
a.create_by,
|
|
|
|
|
a.create_time,
|
|
|
|
|
a.update_by,
|
|
|
|
|
a.update_time,
|
|
|
|
|
a.remark,
|
|
|
|
|
b.qymc as enterpriseName,
|
|
|
|
|
f.road,
|
|
|
|
|
f.enterprise_directory
|
|
|
|
|
FROM
|
|
|
|
|
bms_declaration_records AS a
|
|
|
|
|
LEFT JOIN bms_enterprise_basic_info b ON a.credit_code = b.tyshxydm
|
|
|
|
|
inner join bms_template_record f on a.template_record_id = f.id
|
|
|
|
|
LEFT JOIN bms_template_info c on a.template_id = c.id
|
|
|
|
|
left join sys_dict_data e on a.status = e.dict_value and e.dict_type='bms_approval_status'
|
|
|
|
|
<where>
|
|
|
|
|
<if test="enterpriseDirectory != null and enterpriseDirectory != ''">and f.enterprise_directory like
|
|
|
|
|
concat('%', #{enterpriseDirectory},
|
|
|
|
|
'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="templateName != null and templateName != ''">and c.template_name like concat('%',
|
|
|
|
|
#{templateName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="creditCode != null ">and a.credit_code = #{creditCode}</if>
|
|
|
|
|
<if test="enterpriseId != null ">and a.enterprise_id = #{enterpriseId}</if>
|
|
|
|
|
<if test="level != null ">and c.level = #{level}</if>
|
|
|
|
|
<if test="year != null and year != ''">and year = #{year}</if>
|
|
|
|
|
<if test="responsibilityUnit != null ">and c.responsibility_unit = #{responsibilityUnit}</if>
|
|
|
|
|
<if test="status != null ">and a.status = #{status}</if>
|
|
|
|
|
<if test="statusStr != null and statusStr.size>0">
|
|
|
|
|
and a.status in
|
|
|
|
|
<foreach collection="statusStr" item="item" separator="," open="(" close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="statusChange == 0">
|
|
|
|
|
and a.status in (0,10)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="statusChange == 1">
|
|
|
|
|
and a.status not in (0,10)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="isDeleted != null ">and a.is_deleted = #{isDeleted}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by FIELD(a.status, 0, 1, 2, 3,10,8,7,9,5),a.create_time desc, e.dict_sort desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertBmsDeclarationRecords" parameterType="com.ruoyi.jjh.declaration.entity.BmsDeclarationRecords"
|
|
|
|
|