Browse Source

fix: 修复sql

master_tdsql
hxh 9 months ago
parent
commit
64967c23db
  1. 2
      shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfYhRecordMapper.java
  2. 14
      shuili-system/src/main/resources/mapper/yxgh/DfYhPlanMapper.xml
  3. 14
      shuili-system/src/main/resources/mapper/yxgh/DfYhRecordMapper.xml

2
shuili-system/src/main/java/com/kms/yxgh/df/mapper/DfYhRecordMapper.java

@ -31,7 +31,7 @@ public interface DfYhRecordMapper extends BaseMapper<DfYhRecord> {
@Select("<script>" +
"SELECT yhjl.id, yhjl.plan_id, yhjl.name, yhjl.status, yhjl.supplement," +
"yhjl.doc, yhjl.ledger_doc, yhjl.remark, yhjl.create_time, yhjl.update_time, " +
"df.dike_code, df.dike_name, df.dike_type " +
"df.dike_code, df.dike_name, df.dike_type, " +
"jh.responsible_person " +
"FROM bs_sgc_df_yhjl yhjl " +
"LEFT JOIN bs_sgc_df_yhjh jh ON jh.id = yhjl.plan_id " +

14
shuili-system/src/main/resources/mapper/yxgh/DfYhPlanMapper.xml

@ -50,25 +50,25 @@
<if test='dto.status != null and dto.status != ""'>
AND ts.status = #{dto.status}
</if>
<if test="dto.condition.dikeType != null and dto.condition.dikeType != ''">
<if test="dto.condition!= null and dto.condition.dikeType != null and dto.condition.dikeType != ''">
AND jb.dike_type = #{dto.condition.dikeType}
</if>
<if test='dto.condition.dikeCode != null and dto.condition.dikeCode != ""'>
<if test='dto.condition!= null and dto.condition.dikeCode != null and dto.condition.dikeCode != ""'>
AND jb.dike_code = #{dto.condition.dikeCode}
</if>
<if test='dto.condition.name != null'>
<if test='dto.condition!= null and dto.condition.name != null'>
AND yh.name LIKE CONCAT('%',#{dto.condition.name},'%')
</if>
<if test='dto.condition.adcd != null and dto.condition.adcd != ""'>
<if test='dto.condition!= null and dto.condition.adcd != null and dto.condition.adcd != ""'>
AND jb.adcd LIKE CONCAT(#{dto.condition.adcd},'%')
</if>
<if test='dto.condition.dikeName != null and dto.condition.dikeName != ""'>
<if test='dto.condition!= null and dto.condition.dikeName != null and dto.condition.dikeName != ""'>
AND jb.dike_name LIKE CONCAT('%',#{dto.condition.dikeName},'%')
</if>
<if test='dto.condition.startDate != null'>
<if test='dto.condition!= null and dto.condition.startDate != null and dto.condition.startDate != ""'>
AND yh.start_date &gt;= #{dto.condition.startDate}
</if>
<if test='dto.condition.endDate != null'>
<if test='dto.condition!= null and dto.condition.endDate != null and dto.condition.endDate != ""'>
AND yh.end_date &lt;= #{dto.condition.endDate}
</if>
ORDER BY yh.create_time DESC

14
shuili-system/src/main/resources/mapper/yxgh/DfYhRecordMapper.xml

@ -48,25 +48,25 @@
<if test='dto.status != null and dto.status != ""'>
AND ts.status = #{dto.status}
</if>
<if test='dto.condition.dikeCode != null and dto.condition.dikeCode != ""'>
<if test='dto.condition!= null and dto.condition.dikeCode != null and dto.condition.dikeCode != ""'>
AND yh.dike_code = #{dto.condition.dikeCode}
</if>
<if test='dto.condition.dikeType != null and dto.condition.dikeType != ""'>
<if test='dto.condition!= null and dto.condition.dikeType != null and dto.condition.dikeType != ""'>
AND yh.dike_type = #{dto.condition.dikeType}
</if>
<if test='dto.condition.name != null'>
<if test='dto.condition!= null and dto.condition.name != null'>
AND yh.name LIKE CONCAT('%',#{dto.condition.name},'%')
</if>
<if test='dto.condition.adcd != null and dto.condition.adcd != ""'>
<if test='dto.condition!= null and dto.condition.adcd != null and dto.condition.adcd != ""'>
AND jb.adcd LIKE CONCAT(#{dto.condition.adcd},'%')
</if>
<if test='dto.condition.dikeName != null and dto.condition.dikeName != ""'>
<if test='dto.condition!= null and dto.condition.dikeName != null and dto.condition.dikeName != ""'>
AND yh.dike_name LIKE CONCAT('%',#{dto.condition.dikeName},'%')
</if>
<if test='dto.condition.startDate != null'>
<if test='dto.condition!= null and dto.condition.startDate != null and dto.condition.startDate != ""'>
AND yh.start_date &gt;= #{dto.condition.startDate}
</if>
<if test='dto.condition.endDate != null'>
<if test='dto.condition!= null and dto.condition.endDate != null and dto.condition.endDate != ""'>
AND yh.end_date &lt;= #{dto.condition.endDate}
</if>
ORDER BY yh.create_time DESC

Loading…
Cancel
Save