修改查询语句

This commit is contained in:
wans 2020-12-01 14:40:46 +08:00
parent c6d82a4451
commit 3d3c90b6fa
6 changed files with 22 additions and 12 deletions

View File

@ -163,9 +163,10 @@
t2.telephone
FROM
gen_addicts t1
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number AND t2.is_delete = '0'
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
<if test="addictsId != null and addictsId != ''">
AND t1.addicts_id = #{addictsId}
</if>
@ -197,9 +198,10 @@
CONCAT(t2.current_residence,t2.current_residence_addr) current_residence
FROM
gen_addicts t1
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number AND t2.is_delete = '0'
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
t1.id_card_number LIKE CONCAT('%', #{keywords}, '%')

View File

@ -157,9 +157,10 @@
t2.telephone
FROM
gen_aids t1
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number AND t2.is_delete = '0'
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
<if test="aidsId != null and aidsId != ''">
AND t1.aids_id = #{aidsId}
</if>
@ -190,9 +191,10 @@
CONCAT(t2.current_residence,t2.current_residence_addr) current_residence
FROM
gen_aids t1
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number AND t2.is_delete = '0'
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
t1.id_card_number LIKE CONCAT('%', #{keywords}, '%')

View File

@ -320,9 +320,9 @@
t1.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
t1.id LIKE CONCAT('%', #{keywords}, '%')
t1.full_name LIKE CONCAT('%', #{keywords}, '%')
OR
t1.base_population_info_id LIKE CONCAT('%', #{keywords}, '%')
t1.id_card_number LIKE CONCAT('%', #{keywords}, '%')
<!-- 这里添加其他条件 -->
)
</if>

View File

@ -295,9 +295,10 @@
t2.telephone
FROM
gen_community_correction t1
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number AND t2.is_delete = '0'
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
<if test="communityCorrectionId != null and communityCorrectionId != ''">
AND
t1.community_correction_id = #{communityCorrectionId}
@ -348,9 +349,10 @@
CONCAT(t2.current_residence,t2.current_residence_addr) current_residence
FROM
gen_community_correction t1
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number AND t2.is_delete = '0'
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
t1.id_card_number LIKE CONCAT('%', #{keywords}, '%')

View File

@ -207,9 +207,10 @@
t2.telephone
FROM
gen_mental_disorders t1
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number AND t2.is_delete = '0'
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
<if test="mentalDisordersId != null and mentalDisordersId != ''">
AND
t1.mental_disorders_id = #{mentalDisordersId}
@ -248,9 +249,10 @@
CONCAT(t2.current_residence,t2.current_residence_addr) current_residence
FROM
gen_mental_disorders t1
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number AND t2.is_delete = '0'
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
t1.id_card_number LIKE CONCAT('%', #{keywords}, '%')

View File

@ -186,9 +186,10 @@
t2.telephone
FROM
gen_release_after_sentence t1
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number AND t2.is_delete = '0'
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
<if test="releaseAfterSentenceId != null and releaseAfterSentenceId != ''">
AND t1.release_after_sentence_id = #{releaseAfterSentenceId}
</if>
@ -223,9 +224,10 @@
CONCAT(t2.current_residence,t2.current_residence_addr) current_residence
FROM
gen_release_after_sentence t1
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number AND t2.is_delete = '0'
LEFT JOIN gen_base_population_info t2 ON t1.id_card_number = t2.id_card_number
WHERE
t1.is_delete = 0
AND t2.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
t1.id_card_number LIKE CONCAT('%', #{keywords}, '%')