265 lines
11 KiB
XML
265 lines
11 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.cm.population.dao.releaseaftersentence.IReleaseAfterSentenceDao">
|
|
|
|
<resultMap id="releaseAfterSentenceDTO" type="com.cm.population.pojo.dtos.releaseaftersentence.ReleaseAfterSentenceDTO">
|
|
<id column="release_after_sentence_id" property="releaseAfterSentenceId"/>
|
|
<result column="id_card_number" property="idCardNumber"/>
|
|
<result column="is_cumulative_crime" property="isCumulativeCrime"/>
|
|
<result column="name_of_original_sin" property="nameOfOriginalSin"/>
|
|
<result column="name_of_original_sin_dictionary_name" property="nameOfOriginalSinDictionaryName"/>
|
|
<result column="original_sentence_data" property="originalSentenceData"/>
|
|
<result column="serving_sentence_place" property="servingSentencePlace"/>
|
|
<result column="release_date" property="releaseDate"/>
|
|
<result column="assessment_risk_type" property="assessmentRiskType"/>
|
|
<result column="assessment_risk_type_dictionary_name" property="assessmentRiskTypeDictionaryName"/>
|
|
<result column="link_up_date" property="linkUpDate"/>
|
|
<result column="link_up_situation" property="linkUpSituation"/>
|
|
<result column="link_up_situation_dictionary_name" property="linkUpSituationDictionaryName"/>
|
|
<result column="placement_date" property="placementDate"/>
|
|
<result column="placement_situation" property="placementSituation"/>
|
|
<result column="placement_situation_dictionary_name" property="placementSituationDictionaryName"/>
|
|
<result column="un_placement_reason" property="unPlacementReason"/>
|
|
<result column="help_and_educate" property="helpAndEducate"/>
|
|
<result column="is_crime_again" property="isCrimeAgain"/>
|
|
<result column="is_crime_again_dictionary_name" property="isCrimeAgainDictionaryName"/>
|
|
<result column="crime_again_charge" property="crimeAgainCharge"/>
|
|
<result column="full_name" property="fullName"/>
|
|
<result column="gender" property="gender"/>
|
|
<result column="telephone" property="telephone"/>
|
|
<result column="native_place" property="nativePlace"/>
|
|
<result column="current_residence" property="currentResidence"/>
|
|
</resultMap>
|
|
|
|
<!-- 新增特殊人群-刑满释放人员 -->
|
|
<insert id="saveReleaseAfterSentence" parameterType="map">
|
|
INSERT INTO gen_release_after_sentence(
|
|
release_after_sentence_id,
|
|
id_card_number,
|
|
is_cumulative_crime,
|
|
name_of_original_sin,
|
|
original_sentence_data,
|
|
serving_sentence_place,
|
|
release_date,
|
|
assessment_risk_type,
|
|
link_up_date,
|
|
link_up_situation,
|
|
placement_date,
|
|
placement_situation,
|
|
un_placement_reason,
|
|
help_and_educate,
|
|
is_crime_again,
|
|
crime_again_charge,
|
|
creator,
|
|
gmt_create,
|
|
modifier,
|
|
gmt_modified,
|
|
is_delete
|
|
) VALUES(
|
|
#{releaseAfterSentenceId},
|
|
#{idCardNumber},
|
|
#{isCumulativeCrime},
|
|
#{nameOfOriginalSin},
|
|
#{originalSentenceData},
|
|
#{servingSentencePlace},
|
|
#{releaseDate},
|
|
#{assessmentRiskType},
|
|
#{linkUpDate},
|
|
#{linkUpSituation},
|
|
#{placementDate},
|
|
#{placementSituation},
|
|
#{unPlacementReason},
|
|
#{helpAndEducate},
|
|
#{isCrimeAgain},
|
|
#{crimeAgainCharge},
|
|
#{creator},
|
|
#{gmtCreate},
|
|
#{modifier},
|
|
#{gmtModified},
|
|
#{isDelete}
|
|
)
|
|
</insert>
|
|
|
|
<!-- 删除特殊人群-刑满释放人员 -->
|
|
<update id="removeReleaseAfterSentence" parameterType="map">
|
|
UPDATE
|
|
gen_release_after_sentence
|
|
SET
|
|
is_delete = 1,
|
|
modifier = #{modifier},
|
|
gmt_modified = #{gmtModified}
|
|
WHERE
|
|
release_after_sentence_id IN
|
|
<foreach collection="releaseAfterSentenceIds" index="index" open="(" separator="," close=")">
|
|
#{releaseAfterSentenceIds[${index}]}
|
|
</foreach>
|
|
</update>
|
|
|
|
<!-- 删除特殊人群-刑满释放人员(物理) -->
|
|
<update id="deleteReleaseAfterSentence" parameterType="map">
|
|
DELETE FROM
|
|
gen_release_after_sentence
|
|
WHERE
|
|
release_after_sentence_id IN
|
|
<foreach collection="releaseAfterSentenceIds" index="index" open="(" separator="," close=")">
|
|
#{releaseAfterSentenceIds[${index}]}
|
|
</foreach>
|
|
</update>
|
|
|
|
<!-- 修改特殊人群-刑满释放人员 -->
|
|
<update id="updateReleaseAfterSentence" parameterType="map">
|
|
UPDATE
|
|
gen_release_after_sentence
|
|
SET
|
|
<if test="idCardNumber != null and idCardNumber != ''">
|
|
id_card_number = #{idCardNumber},
|
|
</if>
|
|
<if test="isCumulativeCrime != null and isCumulativeCrime != ''">
|
|
is_cumulative_crime = #{isCumulativeCrime},
|
|
</if>
|
|
<if test="nameOfOriginalSin != null and nameOfOriginalSin != ''">
|
|
name_of_original_sin = #{nameOfOriginalSin},
|
|
</if>
|
|
<if test="originalSentenceData != null and originalSentenceData != ''">
|
|
original_sentence_data = #{originalSentenceData},
|
|
</if>
|
|
<if test="servingSentencePlace != null and servingSentencePlace != ''">
|
|
serving_sentence_place = #{servingSentencePlace},
|
|
</if>
|
|
<if test="releaseDate != null and releaseDate != ''">
|
|
release_date = #{releaseDate},
|
|
</if>
|
|
<if test="assessmentRiskType != null and assessmentRiskType != ''">
|
|
assessment_risk_type = #{assessmentRiskType},
|
|
</if>
|
|
<if test="linkUpDate != null and linkUpDate != ''">
|
|
link_up_date = #{linkUpDate},
|
|
</if>
|
|
<if test="linkUpSituation != null and linkUpSituation != ''">
|
|
link_up_situation = #{linkUpSituation},
|
|
</if>
|
|
<if test="placementDate != null and placementDate != ''">
|
|
placement_date = #{placementDate},
|
|
</if>
|
|
<if test="placementSituation != null and placementSituation != ''">
|
|
placement_situation = #{placementSituation},
|
|
</if>
|
|
<if test="unPlacementReason != null and unPlacementReason != ''">
|
|
un_placement_reason = #{unPlacementReason},
|
|
</if>
|
|
<if test="helpAndEducate != null and helpAndEducate != ''">
|
|
help_and_educate = #{helpAndEducate},
|
|
</if>
|
|
<if test="isCrimeAgain != null and isCrimeAgain != ''">
|
|
is_crime_again = #{isCrimeAgain},
|
|
</if>
|
|
<if test="crimeAgainCharge != null and crimeAgainCharge != ''">
|
|
crime_again_charge = #{crimeAgainCharge},
|
|
</if>
|
|
modifier = #{modifier},
|
|
gmt_modified = #{gmtModified}
|
|
WHERE
|
|
release_after_sentence_id = #{releaseAfterSentenceId}
|
|
</update>
|
|
|
|
<!-- 特殊人群-刑满释放人员详情 -->
|
|
<select id="getReleaseAfterSentence" parameterType="map" resultMap="releaseAfterSentenceDTO">
|
|
SELECT
|
|
t1.id_card_number,
|
|
t1.is_cumulative_crime,
|
|
t1.name_of_original_sin,
|
|
t1.original_sentence_data,
|
|
t1.serving_sentence_place,
|
|
t1.release_date,
|
|
t1.assessment_risk_type,
|
|
t1.link_up_date,
|
|
t1.link_up_situation,
|
|
t1.placement_date,
|
|
t1.placement_situation,
|
|
t1.un_placement_reason,
|
|
t1.help_and_educate,
|
|
t1.is_crime_again,
|
|
t1.crime_again_charge,
|
|
t1.release_after_sentence_id,
|
|
t2.full_name,
|
|
t2.gender,
|
|
t2.telephone
|
|
FROM
|
|
gen_release_after_sentence t1
|
|
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>
|
|
<if test="idCardNumber != null and idCardNumber != ''">
|
|
AND t1.id_card_number = #{idCardNumber}
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 特殊人群-刑满释放人员列表 -->
|
|
<select id="listReleaseAfterSentence" parameterType="map" resultMap="releaseAfterSentenceDTO">
|
|
SELECT
|
|
t1.id_card_number,
|
|
t1.is_cumulative_crime,
|
|
t1.name_of_original_sin,
|
|
t1.original_sentence_data,
|
|
t1.serving_sentence_place,
|
|
t1.release_date,
|
|
t1.assessment_risk_type,
|
|
t1.link_up_date,
|
|
t1.link_up_situation,
|
|
t1.placement_date,
|
|
t1.placement_situation,
|
|
t1.un_placement_reason,
|
|
t1.help_and_educate,
|
|
t1.is_crime_again,
|
|
t1.crime_again_charge,
|
|
t1.release_after_sentence_id,
|
|
t2.full_name,
|
|
t2.gender,
|
|
t2.telephone,
|
|
t2.native_place,
|
|
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
|
|
WHERE
|
|
t1.is_delete = 0
|
|
AND t2.is_delete = 0
|
|
<if test="keywords != null and keywords != ''">
|
|
AND (
|
|
t1.id_card_number LIKE CONCAT('%', #{keywords}, '%')
|
|
OR
|
|
t2.full_name LIKE CONCAT('%', #{keywords}, '%')
|
|
)
|
|
</if>
|
|
<if test="startTime != null and startTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
|
|
</if>
|
|
<if test="endTime != null and endTime != ''">
|
|
AND
|
|
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
|
|
</if>
|
|
<if test="releaseAfterSentenceIds != null and releaseAfterSentenceIds.size > 0">
|
|
AND
|
|
t1.release_after_sentence_id IN
|
|
<foreach collection="releaseAfterSentenceIds" index="index" open="(" separator="," close=")">
|
|
#{releaseAfterSentenceIds[${index}]}
|
|
</foreach>
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 特殊人群-刑满释放人员统计 -->
|
|
<select id="countReleaseAfterSentence" parameterType="map" resultType="Integer">
|
|
SELECT
|
|
COUNT(*)
|
|
FROM
|
|
gen_release_after_sentence t1
|
|
WHERE
|
|
t1.is_delete = 0
|
|
</select>
|
|
|
|
</mapper> |