81 lines
No EOL
2.8 KiB
XML
81 lines
No EOL
2.8 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="ru.nbch.credit_tracker.mapper.signal.PhoneFidMapMapper">
|
|
|
|
<resultMap id="PhoneFidMapResultMap" type="ru.nbch.credit_tracker.entities.dto.PhoneFidMap">
|
|
<result property="id" column="id"/>
|
|
<result property="packageId" column="package_id"/>
|
|
<result property="subjectId" column="subject_id"/>
|
|
<result property="phone" column="phone"/>
|
|
<result property="fid" column="fid"/>
|
|
<result property="flagDebt5000" column="flag_debt5000"/>
|
|
<result property="flag90days" column="flag_90_12"/>
|
|
<result property="calculatedAt" column="calculated_at"/>
|
|
</resultMap>
|
|
|
|
<insert id="registerSubjects" parameterType="java.util.List">
|
|
INSERT INTO signals_phone_fid_map (subject_id, phone, fid, package_id)
|
|
values
|
|
<foreach collection="subjects" item="subject" separator=",">
|
|
(#{subject.id}, #{subject.clientId}, NULL, #{packageId})
|
|
</foreach>
|
|
</insert>
|
|
|
|
|
|
<update id="updatePhoneFidMaps" parameterType="java.util.List">
|
|
<foreach collection="subjects" item="subject" separator=";">
|
|
UPDATE signals_phone_fid_map
|
|
SET
|
|
package_id = #{subject.packageId},
|
|
subject_id = #{subject.subjectId},
|
|
phone = #{subject.phone},
|
|
fid = #{subject.fid},
|
|
flag_debt5000 = #{subject.flagDebt5000},
|
|
flag_90_12 = #{subject.flag90days},
|
|
calculated_at = #{subject.calculatedAt}
|
|
WHERE id = #{subject.id}
|
|
</foreach>
|
|
</update>
|
|
|
|
<select id="findPhoneFidMaps" resultMap="PhoneFidMapResultMap" resultType="java.util.List">
|
|
SELECT id, subject_id, phone
|
|
FROM signals_phone_fid_map
|
|
WHERE package_id = #{packageId}
|
|
ORDER BY id
|
|
LIMIT #{limit} OFFSET #{offset}
|
|
</select>
|
|
|
|
<select id="findFullPhoneFidMap" resultMap="PhoneFidMapResultMap" resultType="java.util.List">
|
|
SELECT id,
|
|
package_id,
|
|
subject_id,
|
|
phone,
|
|
fid,
|
|
flag_90_12,
|
|
flag_debt5000,
|
|
calculated_at
|
|
FROM signals_phone_fid_map
|
|
WHERE package_id = #{packageId}
|
|
ORDER BY id
|
|
LIMIT #{limit} OFFSET #{offset}
|
|
</select>
|
|
|
|
<select id="findPhoneFidMapById" resultMap="PhoneFidMapResultMap" resultType="ru.nbch.credit_tracker.entities.dto.PhoneFidMap">
|
|
SELECT id,
|
|
package_id,
|
|
subject_id,
|
|
phone,
|
|
fid,
|
|
flag_90_12,
|
|
flag_debt5000,
|
|
calculated_at
|
|
FROM signals_phone_fid_map
|
|
WHERE id = #{id}
|
|
LIMIT 1
|
|
</select>
|
|
|
|
|
|
</mapper> |