|
|
|
@ -18,46 +18,6 @@
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="selectTemplateRecordVo" parameterType="com.ruoyi.jjh.declaration.entity.dto.BmsTemplateRecordQueryDto"
|
|
|
|
|
resultType="com.ruoyi.jjh.declaration.entity.vo.BmsTemplateRecordQueryVo">
|
|
|
|
|
SELECT
|
|
|
|
|
a.id as templateRecordId,
|
|
|
|
|
a.status,
|
|
|
|
|
a.enterprise_directory,
|
|
|
|
|
b.project_small_type as projectClassify,
|
|
|
|
|
b.id as templateId,
|
|
|
|
|
b.template_name,
|
|
|
|
|
b.LEVEL,
|
|
|
|
|
a.road,
|
|
|
|
|
a.file_name,
|
|
|
|
|
a.start_time,
|
|
|
|
|
a.end_time,
|
|
|
|
|
b.responsibility_unit,
|
|
|
|
|
a.create_time
|
|
|
|
|
FROM
|
|
|
|
|
bms_template_record a
|
|
|
|
|
INNER JOIN bms_template_info b ON a.template_id = b.id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="req.enterpriseDirectory != null and req.enterpriseDirectory != ''">and a.enterprise_directory
|
|
|
|
|
like
|
|
|
|
|
concat('%', #{req.enterpriseDirectory}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.templateId != null ">and b.id = #{req.templateId}</if>
|
|
|
|
|
<if test="req.startTime != null ">
|
|
|
|
|
and date_format(a.create_time ,'%y%m%d') >= date_format(#{req.startTime},'%y%m%d')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.endTime != null ">
|
|
|
|
|
and date_format(a.create_time,'%y%m%d') <= date_format(#{req.endTime},'%y%m%d')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.road != null ">and a.road = #{req.road}</if>
|
|
|
|
|
<if test="req.level != null ">and b.level = #{req.level}</if>
|
|
|
|
|
<if test="req.responsibilityUnit != null ">and b.responsibility_unit = #{req.responsibilityUnit}</if>
|
|
|
|
|
<if test="req.templateName != null and req.templateName != ''">and b.template_name like concat('%',
|
|
|
|
|
#{req.templateName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by a.create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectBmsTemplateRecordVoById" resultType="com.ruoyi.jjh.declaration.entity.vo.BmsTemplateRecordVo">
|
|
|
|
|
SELECT a.id,
|
|
|
|
|
a.template_id,
|
|
|
|
@ -113,5 +73,47 @@
|
|
|
|
|
AND end_time >= NOW()
|
|
|
|
|
order by a.create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectTemplateRecordVo"
|
|
|
|
|
resultType="com.ruoyi.jjh.declaration.entity.vo.BmsTemplateRecordQueryVo">
|
|
|
|
|
SELECT
|
|
|
|
|
a.id as templateRecordId,
|
|
|
|
|
a.status,
|
|
|
|
|
a.enterprise_directory,
|
|
|
|
|
b.project_small_type as projectClassify,
|
|
|
|
|
b.id as templateId,
|
|
|
|
|
b.template_name,
|
|
|
|
|
b.LEVEL,
|
|
|
|
|
a.road,
|
|
|
|
|
a.file_name,
|
|
|
|
|
a.start_time,
|
|
|
|
|
a.end_time,
|
|
|
|
|
b.responsibility_unit,
|
|
|
|
|
a.create_time,
|
|
|
|
|
a.create_by as createByName,
|
|
|
|
|
a.notes as notes
|
|
|
|
|
FROM
|
|
|
|
|
bms_template_record a
|
|
|
|
|
INNER JOIN bms_template_info b ON a.template_id = b.id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="req.enterpriseDirectory != null and req.enterpriseDirectory != ''">and a.enterprise_directory
|
|
|
|
|
like
|
|
|
|
|
concat('%', #{req.enterpriseDirectory}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.templateId != null ">and b.id = #{req.templateId}</if>
|
|
|
|
|
<if test="req.startTime != null ">
|
|
|
|
|
and date_format(a.create_time ,'%y%m%d') >= date_format(#{req.startTime},'%y%m%d')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.endTime != null ">
|
|
|
|
|
and date_format(a.create_time,'%y%m%d') <= date_format(#{req.endTime},'%y%m%d')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="req.road != null ">and a.road = #{req.road}</if>
|
|
|
|
|
<if test="req.level != null ">and b.level = #{req.level}</if>
|
|
|
|
|
<if test="req.responsibilityUnit != null ">and b.responsibility_unit = #{req.responsibilityUnit}</if>
|
|
|
|
|
<if test="req.templateName != null and req.templateName != ''">and b.template_name like concat('%',
|
|
|
|
|
#{req.templateName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by a.create_time desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|