<?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="cn.com.tenlion.systembase.dao.homicidevictim.IHomicideVictimDao">

    <resultMap id="homicideVictimDTO" type="cn.com.tenlion.systembase.pojo.dtos.homicidevictim.HomicideVictimDTO">
        <result column="homicide_victim_id" property="homicideVictimId"/>
        <result column="homicide_id" property="homicideId"/>
        <result column="homicide_name" property="homicideName"/>
        <result column="homicide_code" property="homicideCode"/>
        <result column="card_code" property="cardCode"/>
        <result column="card_code_name" property="cardCodeName"/>
        <result column="card_code_code" property="cardCodeCode"/>
        <result column="card_num" property="cardNum"/>
        <result column="name" property="name"/>
        <result column="sex" property="sex"/>
        <result column="sex_name" property="sexName"/>
        <result column="sex_code" property="sexCode"/>
        <result column="birthday" property="birthday"/>
        <result column="nationality" property="nationality"/>
        <result column="nationality_name" property="nationalityName"/>
        <result column="nationality_code" property="nationalityCode"/>
        <result column="nation" property="nation"/>
        <result column="nation_name" property="nationName"/>
        <result column="nation_code" property="nationCode"/>
        <result column="native_place" property="nativePlace"/>
        <result column="native_place_name" property="nativePlaceName"/>
        <result column="native_place_code" property="nativePlaceCode"/>
        <result column="marital" property="marital"/>
        <result column="marital_name" property="maritalName"/>
        <result column="marital_code" property="maritalCode"/>
        <result column="political_outlook" property="politicalOutlook"/>
        <result column="political_outlook_name" property="politicalOutlookName"/>
        <result column="political_outlook_code" property="politicalOutlookCode"/>
        <result column="education" property="education"/>
        <result column="education_name" property="educationName"/>
        <result column="education_code" property="educationCode"/>
        <result column="religious" property="religious"/>
        <result column="religious_name" property="religiousName"/>
        <result column="religious_code" property="religiousCode"/>
        <result column="work_type" property="workType"/>
        <result column="work_type_name" property="workTypeName"/>
        <result column="work_type_code" property="workTypeCode"/>
        <result column="work" property="work"/>
        <result column="service_premises" property="servicePremises"/>
        <result column="household_register" property="householdRegister"/>
        <result column="household_register_name" property="householdRegisterName"/>
        <result column="household_register_code" property="householdRegisterCode"/>
        <result column="household_register_address" property="householdRegisterAddress"/>
        <result column="current_residence" property="currentResidence"/>
        <result column="current_residence_name" property="currentResidenceName"/>
        <result column="current_residence_code" property="currentResidenceCode"/>
        <result column="current_residence_address" property="currentResidenceAddress"/>
    </resultMap>

    <resultMap id="homicideVictimBO" type="cn.com.tenlion.systembase.pojo.bos.homicidevictim.HomicideVictimBO">
        <result column="homicide_victim_id" property="homicideVictimId"/>
        <result column="homicide_id" property="homicideId"/>
        <result column="homicide_name" property="homicideName"/>
        <result column="homicide_code" property="homicideCode"/>
        <result column="card_code" property="cardCode"/>
        <result column="card_code_name" property="cardCodeName"/>
        <result column="card_code_code" property="cardCodeCode"/>
        <result column="card_num" property="cardNum"/>
        <result column="name" property="name"/>
        <result column="sex" property="sex"/>
        <result column="sex_name" property="sexName"/>
        <result column="sex_code" property="sexCode"/>
        <result column="birthday" property="birthday"/>
        <result column="nationality" property="nationality"/>
        <result column="nationality_name" property="nationalityName"/>
        <result column="nationality_code" property="nationalityCode"/>
        <result column="nation" property="nation"/>
        <result column="nation_name" property="nationName"/>
        <result column="nation_code" property="nationCode"/>
        <result column="native_place" property="nativePlace"/>
        <result column="native_place_name" property="nativePlaceName"/>
        <result column="native_place_code" property="nativePlaceCode"/>
        <result column="marital" property="marital"/>
        <result column="marital_name" property="maritalName"/>
        <result column="marital_code" property="maritalCode"/>
        <result column="political_outlook" property="politicalOutlook"/>
        <result column="political_outlook_name" property="politicalOutlookName"/>
        <result column="political_outlook_code" property="politicalOutlookCode"/>
        <result column="education" property="education"/>
        <result column="education_name" property="educationName"/>
        <result column="education_code" property="educationCode"/>
        <result column="religious" property="religious"/>
        <result column="religious_name" property="religiousName"/>
        <result column="religious_code" property="religiousCode"/>
        <result column="work_type" property="workType"/>
        <result column="work_type_name" property="workTypeName"/>
        <result column="work_type_code" property="workTypeCode"/>
        <result column="work" property="work"/>
        <result column="service_premises" property="servicePremises"/>
        <result column="household_register" property="householdRegister"/>
        <result column="household_register_name" property="householdRegisterName"/>
        <result column="household_register_code" property="householdRegisterCode"/>
        <result column="household_register_address" property="householdRegisterAddress"/>
        <result column="current_residence" property="currentResidence"/>
        <result column="current_residence_name" property="currentResidenceName"/>
        <result column="current_residence_code" property="currentResidenceCode"/>
        <result column="current_residence_address" property="currentResidenceAddress"/>
    </resultMap>

    <resultMap id="homicideVictimPO" type="cn.com.tenlion.systembase.pojo.pos.homicidevictim.HomicideVictimPO">
        <result column="homicide_victim_id" property="homicideVictimId"/>
        <result column="homicide_id" property="homicideId"/>
        <result column="homicide_name" property="homicideName"/>
        <result column="homicide_code" property="homicideCode"/>
        <result column="card_code" property="cardCode"/>
        <result column="card_code_name" property="cardCodeName"/>
        <result column="card_code_code" property="cardCodeCode"/>
        <result column="card_num" property="cardNum"/>
        <result column="name" property="name"/>
        <result column="sex" property="sex"/>
        <result column="sex_name" property="sexName"/>
        <result column="sex_code" property="sexCode"/>
        <result column="birthday" property="birthday"/>
        <result column="nationality" property="nationality"/>
        <result column="nationality_name" property="nationalityName"/>
        <result column="nationality_code" property="nationalityCode"/>
        <result column="nation" property="nation"/>
        <result column="nation_name" property="nationName"/>
        <result column="nation_code" property="nationCode"/>
        <result column="native_place" property="nativePlace"/>
        <result column="native_place_name" property="nativePlaceName"/>
        <result column="native_place_code" property="nativePlaceCode"/>
        <result column="marital" property="marital"/>
        <result column="marital_name" property="maritalName"/>
        <result column="marital_code" property="maritalCode"/>
        <result column="political_outlook" property="politicalOutlook"/>
        <result column="political_outlook_name" property="politicalOutlookName"/>
        <result column="political_outlook_code" property="politicalOutlookCode"/>
        <result column="education" property="education"/>
        <result column="education_name" property="educationName"/>
        <result column="education_code" property="educationCode"/>
        <result column="religious" property="religious"/>
        <result column="religious_name" property="religiousName"/>
        <result column="religious_code" property="religiousCode"/>
        <result column="work_type" property="workType"/>
        <result column="work_type_name" property="workTypeName"/>
        <result column="work_type_code" property="workTypeCode"/>
        <result column="work" property="work"/>
        <result column="service_premises" property="servicePremises"/>
        <result column="household_register" property="householdRegister"/>
        <result column="household_register_name" property="householdRegisterName"/>
        <result column="household_register_code" property="householdRegisterCode"/>
        <result column="household_register_address" property="householdRegisterAddress"/>
        <result column="current_residence" property="currentResidence"/>
        <result column="current_residence_name" property="currentResidenceName"/>
        <result column="current_residence_code" property="currentResidenceCode"/>
        <result column="current_residence_address" property="currentResidenceAddress"/>
    </resultMap>

    <!-- 新增命案受害人 -->
    <insert id="save" parameterType="map">
        INSERT INTO data_homicide_victim(
            homicide_victim_id,
            homicide_id,
            homicide_name,
            homicide_code,
            card_code,
            card_code_name,
            card_code_code,
            card_num,
            name,
            sex,
            sex_name,
            sex_code,
            birthday,
            nationality,
            nationality_name,
            nationality_code,
            nation,
            nation_name,
            nation_code,
            native_place,
            native_place_name,
            native_place_code,
            marital,
            marital_name,
            marital_code,
            political_outlook,
            political_outlook_name,
            political_outlook_code,
            education,
            education_name,
            education_code,
            religious,
            religious_name,
            religious_code,
            work_type,
            work_type_name,
            work_type_code,
            work,
            service_premises,
            household_register,
            household_register_name,
            household_register_code,
            household_register_address,
            current_residence,
            current_residence_name,
            current_residence_code,
            current_residence_address,
            creator,
            gmt_create,
            modifier,
            gmt_modified,
            is_delete
        ) VALUES(
            #{homicideVictimId},
            #{homicideId},
            #{homicideName},
            #{homicideCode},
            #{cardCode},
            #{cardCodeName},
            #{cardCodeCode},
            #{cardNum},
            #{name},
            #{sex},
            #{sexName},
            #{sexCode},
            #{birthday},
            #{nationality},
            #{nationalityName},
            #{nationalityCode},
            #{nation},
            #{nationName},
            #{nationCode},
            #{nativePlace},
            #{nativePlaceName},
            #{nativePlaceCode},
            #{marital},
            #{maritalName},
            #{maritalCode},
            #{politicalOutlook},
            #{politicalOutlookName},
            #{politicalOutlookCode},
            #{education},
            #{educationName},
            #{educationCode},
            #{religious},
            #{religiousName},
            #{religiousCode},
            #{workType},
            #{workTypeName},
            #{workTypeCode},
            #{work},
            #{servicePremises},
            #{householdRegister},
            #{householdRegisterName},
            #{householdRegisterCode},
            #{householdRegisterAddress},
            #{currentResidence},
            #{currentResidenceName},
            #{currentResidenceCode},
            #{currentResidenceAddress},
            #{creator},
            #{gmtCreate},
            #{modifier},
            #{gmtModified},
            #{isDelete}
        )
    </insert>

    <!-- 删除命案受害人 -->
    <update id="remove" parameterType="map">
        UPDATE
            data_homicide_victim
        SET
            gmt_modified = #{gmtModified},
            modifier = #{modifier},
            is_delete = 1
        WHERE
            homicide_victim_id IN
        <foreach collection="homicideVictimIds" index="index" open="(" separator="," close=")">
            #{homicideVictimIds[${index}]}
        </foreach>
    </update>

    <!-- 删除命案受害人（物理） -->
    <update id="delete" parameterType="map">
        DELETE FROM
            data_homicide_victim
        WHERE
            homicide_victim_id IN
        <foreach collection="homicideVictimIds" index="index" open="(" separator="," close=")">
            #{homicideVictimIds[${index}]}
        </foreach>
    </update>

    <!-- 修改命案受害人 -->
    <update id="update" parameterType="map">
        UPDATE
            data_homicide_victim
        SET
        <if test="homicideId != null and homicideId != ''">
            homicide_id = #{homicideId},
        </if>
        <if test="homicideName != null and homicideName != ''">
            homicide_name = #{homicideName},
        </if>
        <if test="homicideCode != null and homicideCode != ''">
            homicide_code = #{homicideCode},
        </if>
        <if test="cardCode != null">
            card_code = #{cardCode},
        </if>
        <if test="cardCodeName != null and cardCodeName != ''">
            card_code_name = #{cardCodeName},
        </if>
        <if test="cardCodeCode != null and cardCodeCode != ''">
            card_code_code = #{cardCodeCode},
        </if>
        <if test="cardNum != null and cardNum != ''">
            card_num = #{cardNum},
        </if>
        <if test="name != null and name != ''">
            name = #{name},
        </if>
        <if test="sex != null">
            sex = #{sex},
        </if>
        <if test="sexName != null and sexName != ''">
            sex_name = #{sexName},
        </if>
        <if test="sexCode != null and sexCode != ''">
            sex_code = #{sexCode},
        </if>
        <if test="birthday != null and birthday != ''">
            birthday = #{birthday},
        </if>
        <if test="nationality != null">
            nationality = #{nationality},
        </if>
        <if test="nationalityName != null and nationalityName != ''">
            nationality_name = #{nationalityName},
        </if>
        <if test="nationalityCode != null and nationalityCode != ''">
            nationality_code = #{nationalityCode},
        </if>
        <if test="nation != null">
            nation = #{nation},
        </if>
        <if test="nationName != null and nationName != ''">
            nation_name = #{nationName},
        </if>
        <if test="nationCode != null and nationCode != ''">
            nation_code = #{nationCode},
        </if>
        <if test="nativePlace != null">
            native_place = #{nativePlace},
        </if>
        <if test="nativePlaceName != null and nativePlaceName != ''">
            native_place_name = #{nativePlaceName},
        </if>
        <if test="nativePlaceCode != null and nativePlaceCode != ''">
            native_place_code = #{nativePlaceCode},
        </if>
        <if test="marital != null">
            marital = #{marital},
        </if>
        <if test="maritalName != null and maritalName != ''">
            marital_name = #{maritalName},
        </if>
        <if test="maritalCode != null and maritalCode != ''">
            marital_code = #{maritalCode},
        </if>
        <if test="politicalOutlook != null">
            political_outlook = #{politicalOutlook},
        </if>
        <if test="politicalOutlookName != null and politicalOutlookName != ''">
            political_outlook_name = #{politicalOutlookName},
        </if>
        <if test="politicalOutlookCode != null and politicalOutlookCode != ''">
            political_outlook_code = #{politicalOutlookCode},
        </if>
        <if test="education != null">
            education = #{education},
        </if>
        <if test="educationName != null and educationName != ''">
            education_name = #{educationName},
        </if>
        <if test="educationCode != null and educationCode != ''">
            education_code = #{educationCode},
        </if>
        <if test="religious != null">
            religious = #{religious},
        </if>
        <if test="religiousName != null and religiousName != ''">
            religious_name = #{religiousName},
        </if>
        <if test="religiousCode != null and religiousCode != ''">
            religious_code = #{religiousCode},
        </if>
        <if test="workType != null">
            work_type = #{workType},
        </if>
        <if test="workTypeName != null and workTypeName != ''">
            work_type_name = #{workTypeName},
        </if>
        <if test="workTypeCode != null and workTypeCode != ''">
            work_type_code = #{workTypeCode},
        </if>
        <if test="work != null and work != ''">
            work = #{work},
        </if>
        <if test="servicePremises != null and servicePremises != ''">
            service_premises = #{servicePremises},
        </if>
        <if test="householdRegister != null">
            household_register = #{householdRegister},
        </if>
        <if test="householdRegisterName != null and householdRegisterName != ''">
            household_register_name = #{householdRegisterName},
        </if>
        <if test="householdRegisterCode != null and householdRegisterCode != ''">
            household_register_code = #{householdRegisterCode},
        </if>
        <if test="householdRegisterAddress != null and householdRegisterAddress != ''">
            household_register_address = #{householdRegisterAddress},
        </if>
        <if test="currentResidence != null">
            current_residence = #{currentResidence},
        </if>
        <if test="currentResidenceName != null and currentResidenceName != ''">
            current_residence_name = #{currentResidenceName},
        </if>
        <if test="currentResidenceCode != null and currentResidenceCode != ''">
            current_residence_code = #{currentResidenceCode},
        </if>
        <if test="currentResidenceAddress != null and currentResidenceAddress != ''">
            current_residence_address = #{currentResidenceAddress},
        </if>
            gmt_modified = #{gmtModified},
            modifier = #{modifier},
            homicide_victim_id = homicide_victim_id
        WHERE
            homicide_victim_id = #{homicideVictimId}
    </update>

    <!-- 命案受害人详情 -->
    <select id="get" parameterType="map" resultMap="homicideVictimDTO">
        SELECT
            t1.homicide_id,
            t1.homicide_name,
            t1.homicide_code,
            t1.card_code,
            t1.card_code_name,
            t1.card_code_code,
            t1.card_num,
            t1.name,
            t1.sex,
            t1.sex_name,
            t1.sex_code,
            t1.birthday,
            t1.nationality,
            t1.nationality_name,
            t1.nationality_code,
            t1.nation,
            t1.nation_name,
            t1.nation_code,
            t1.native_place,
            t1.native_place_name,
            t1.native_place_code,
            t1.marital,
            t1.marital_name,
            t1.marital_code,
            t1.political_outlook,
            t1.political_outlook_name,
            t1.political_outlook_code,
            t1.education,
            t1.education_name,
            t1.education_code,
            t1.religious,
            t1.religious_name,
            t1.religious_code,
            t1.work_type,
            t1.work_type_name,
            t1.work_type_code,
            t1.work,
            t1.service_premises,
            t1.household_register,
            t1.household_register_name,
            t1.household_register_code,
            t1.household_register_address,
            t1.current_residence,
            t1.current_residence_name,
            t1.current_residence_code,
            t1.current_residence_address,
            t1.homicide_victim_id
        FROM
            data_homicide_victim t1
        WHERE
            t1.is_delete = 0
            <if test="homicideVictimId != null and homicideVictimId != ''">
        AND
            t1.homicide_victim_id = #{homicideVictimId}
            </if>
    </select>

    <!-- 命案受害人详情 -->
    <select id="getBO" parameterType="map" resultMap="homicideVictimBO">
        SELECT
            t1.homicide_victim_id,
            t1.homicide_id,
            t1.homicide_name,
            t1.homicide_code,
            t1.card_code,
            t1.card_code_name,
            t1.card_code_code,
            t1.card_num,
            t1.name,
            t1.sex,
            t1.sex_name,
            t1.sex_code,
            t1.birthday,
            t1.nationality,
            t1.nationality_name,
            t1.nationality_code,
            t1.nation,
            t1.nation_name,
            t1.nation_code,
            t1.native_place,
            t1.native_place_name,
            t1.native_place_code,
            t1.marital,
            t1.marital_name,
            t1.marital_code,
            t1.political_outlook,
            t1.political_outlook_name,
            t1.political_outlook_code,
            t1.education,
            t1.education_name,
            t1.education_code,
            t1.religious,
            t1.religious_name,
            t1.religious_code,
            t1.work_type,
            t1.work_type_name,
            t1.work_type_code,
            t1.work,
            t1.service_premises,
            t1.household_register,
            t1.household_register_name,
            t1.household_register_code,
            t1.household_register_address,
            t1.current_residence,
            t1.current_residence_name,
            t1.current_residence_code,
            t1.current_residence_address
        FROM
            data_homicide_victim t1
        WHERE
            t1.is_delete = 0
            <if test="homicideVictimId != null and homicideVictimId != ''">
        AND
            t1.homicide_victim_id = #{homicideVictimId}
            </if>
    </select>

    <!-- 命案受害人详情 -->
    <select id="getPO" parameterType="map" resultMap="homicideVictimPO">
        SELECT
            t1.homicide_victim_id,
            t1.homicide_id,
            t1.homicide_name,
            t1.homicide_code,
            t1.card_code,
            t1.card_code_name,
            t1.card_code_code,
            t1.card_num,
            t1.name,
            t1.sex,
            t1.sex_name,
            t1.sex_code,
            t1.birthday,
            t1.nationality,
            t1.nationality_name,
            t1.nationality_code,
            t1.nation,
            t1.nation_name,
            t1.nation_code,
            t1.native_place,
            t1.native_place_name,
            t1.native_place_code,
            t1.marital,
            t1.marital_name,
            t1.marital_code,
            t1.political_outlook,
            t1.political_outlook_name,
            t1.political_outlook_code,
            t1.education,
            t1.education_name,
            t1.education_code,
            t1.religious,
            t1.religious_name,
            t1.religious_code,
            t1.work_type,
            t1.work_type_name,
            t1.work_type_code,
            t1.work,
            t1.service_premises,
            t1.household_register,
            t1.household_register_name,
            t1.household_register_code,
            t1.household_register_address,
            t1.current_residence,
            t1.current_residence_name,
            t1.current_residence_code,
            t1.current_residence_address
        FROM
            data_homicide_victim t1
        WHERE
            t1.is_delete = 0
            <if test="homicideVictimId != null and homicideVictimId != ''">
        AND
            t1.homicide_victim_id = #{homicideVictimId}
            </if>
    </select>

    <!-- 命案受害人列表 -->
    <select id="list" parameterType="map" resultMap="homicideVictimDTO">
        SELECT
            t1.homicide_victim_id,
            t1.homicide_id,
            t1.homicide_name,
            t1.homicide_code,
            t1.card_code,
            t1.card_code_name,
            t1.card_code_code,
            t1.card_num,
            t1.name,
            t1.sex,
            t1.sex_name,
            t1.sex_code,
            t1.birthday,
            t1.nationality,
            t1.nationality_name,
            t1.nationality_code,
            t1.nation,
            t1.nation_name,
            t1.nation_code,
            t1.native_place,
            t1.native_place_name,
            t1.native_place_code,
            t1.marital,
            t1.marital_name,
            t1.marital_code,
            t1.political_outlook,
            t1.political_outlook_name,
            t1.political_outlook_code,
            t1.education,
            t1.education_name,
            t1.education_code,
            t1.religious,
            t1.religious_name,
            t1.religious_code,
            t1.work_type,
            t1.work_type_name,
            t1.work_type_code,
            t1.work,
            t1.service_premises,
            t1.household_register,
            t1.household_register_name,
            t1.household_register_code,
            t1.household_register_address,
            t1.current_residence,
            t1.current_residence_name,
            t1.current_residence_code,
            t1.current_residence_address,
            1
        FROM
            data_homicide_victim t1
        WHERE
            t1.is_delete = 0
        <if test="homicideId != null and homicideId != ''">
            AND
            t1.homicide_id = #{homicideId}
        </if>
        <if test="keywords != null and keywords != ''">
        AND (
            <!-- 这里添加其他条件 -->
            t1.id 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="homicideVictimIds != null and homicideVictimIds.size > 0">
        AND
            t1.homicide_victim_id IN
            <foreach collection="homicideVictimIds" index="index" open="(" separator="," close=")">
                #{homicideVictimIds[${index}]}
            </foreach>
        </if>
    </select>

    <!-- 命案受害人列表 -->
    <select id="listBO" parameterType="map" resultMap="homicideVictimBO">
        SELECT
            t1.homicide_victim_id,
            t1.homicide_id,
            t1.homicide_name,
            t1.homicide_code,
            t1.card_code,
            t1.card_code_name,
            t1.card_code_code,
            t1.card_num,
            t1.name,
            t1.sex,
            t1.sex_name,
            t1.sex_code,
            t1.birthday,
            t1.nationality,
            t1.nationality_name,
            t1.nationality_code,
            t1.nation,
            t1.nation_name,
            t1.nation_code,
            t1.native_place,
            t1.native_place_name,
            t1.native_place_code,
            t1.marital,
            t1.marital_name,
            t1.marital_code,
            t1.political_outlook,
            t1.political_outlook_name,
            t1.political_outlook_code,
            t1.education,
            t1.education_name,
            t1.education_code,
            t1.religious,
            t1.religious_name,
            t1.religious_code,
            t1.work_type,
            t1.work_type_name,
            t1.work_type_code,
            t1.work,
            t1.service_premises,
            t1.household_register,
            t1.household_register_name,
            t1.household_register_code,
            t1.household_register_address,
            t1.current_residence,
            t1.current_residence_name,
            t1.current_residence_code,
            t1.current_residence_address
        FROM
            data_homicide_victim t1
        WHERE
            t1.is_delete = 0
        <if test="keywords != null and keywords != ''">
        AND (
            <!-- 这里添加其他条件 -->
            t1.id 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="homicideVictimIds != null and homicideVictimIds.size > 0">
        AND
            t1.homicide_victim_id IN
            <foreach collection="homicideVictimIds" index="index" open="(" separator="," close=")">
                #{homicideVictimIds[${index}]}
            </foreach>
        </if>
    </select>

    <!-- 命案受害人列表 -->
    <select id="listPO" parameterType="map" resultMap="homicideVictimPO">
        SELECT
            t1.homicide_victim_id,
            t1.homicide_id,
            t1.homicide_name,
            t1.homicide_code,
            t1.card_code,
            t1.card_code_name,
            t1.card_code_code,
            t1.card_num,
            t1.name,
            t1.sex,
            t1.sex_name,
            t1.sex_code,
            t1.birthday,
            t1.nationality,
            t1.nationality_name,
            t1.nationality_code,
            t1.nation,
            t1.nation_name,
            t1.nation_code,
            t1.native_place,
            t1.native_place_name,
            t1.native_place_code,
            t1.marital,
            t1.marital_name,
            t1.marital_code,
            t1.political_outlook,
            t1.political_outlook_name,
            t1.political_outlook_code,
            t1.education,
            t1.education_name,
            t1.education_code,
            t1.religious,
            t1.religious_name,
            t1.religious_code,
            t1.work_type,
            t1.work_type_name,
            t1.work_type_code,
            t1.work,
            t1.service_premises,
            t1.household_register,
            t1.household_register_name,
            t1.household_register_code,
            t1.household_register_address,
            t1.current_residence,
            t1.current_residence_name,
            t1.current_residence_code,
            t1.current_residence_address
        FROM
            data_homicide_victim t1
        WHERE
            t1.is_delete = 0
        <if test="keywords != null and keywords != ''">
        AND (
            <!-- 这里添加其他条件 -->
            t1.id 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="homicideVictimIds != null and homicideVictimIds.size > 0">
        AND
            t1.homicide_victim_id IN
            <foreach collection="homicideVictimIds" index="index" open="(" separator="," close=")">
                #{homicideVictimIds[${index}]}
            </foreach>
        </if>
    </select>

    <!-- 命案受害人统计  -->
    <select id="count" parameterType="map" resultType="Integer">
        SELECT
            COUNT(*)
        FROM
            data_homicide_victim t1
        WHERE
            t1.is_delete = 0
    </select>

</mapper>