This commit is contained in:
van
2026-05-09 23:27:52 +08:00
parent 30ff4077fe
commit 7582d22d2a
6 changed files with 183 additions and 86 deletions

View File

@@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TgScalperPhone" id="TgScalperPhoneResult">
<result property="id" column="id" />
<result property="phone" column="phone" />
<result property="phones" column="phones" />
<result property="remark" column="remark" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
@@ -14,14 +14,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectTgScalperPhoneVo">
select id, phone, remark, status, create_time, update_time
select id, phones, remark, status, create_time, update_time
from jarvis_tg_scalper_phone
</sql>
<select id="selectTgScalperPhoneList" parameterType="TgScalperPhone" resultMap="TgScalperPhoneResult">
<include refid="selectTgScalperPhoneVo"/>
<where>
<if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if>
<if test="phoneQuery != null and phoneQuery != ''">
and (
JSON_CONTAINS(phones, JSON_QUOTE(#{phoneQuery}), '$')
or phones like concat('%', #{phoneQuery}, '%')
)
</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
<if test="status != null"> and status = #{status}</if>
</where>
@@ -33,28 +38,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</select>
<select id="selectTgScalperPhoneByPhone" parameterType="String" resultMap="TgScalperPhoneResult">
<include refid="selectTgScalperPhoneVo"/>
where phone = #{phone}
<select id="selectIdHavingPhone" resultType="java.lang.Long">
select id from jarvis_tg_scalper_phone
where JSON_CONTAINS(phones, JSON_QUOTE(#{cellPhone}), '$')
<if test="excludeId != null">and id != #{excludeId}</if>
limit 1
</select>
<select id="selectEnabledByPhone" parameterType="String" resultMap="TgScalperPhoneResult">
<include refid="selectTgScalperPhoneVo"/>
where phone = #{phone} and status = 1
where status = 1 and JSON_CONTAINS(phones, JSON_QUOTE(#{phone}), '$')
limit 1
</select>
<insert id="insertTgScalperPhone" parameterType="TgScalperPhone" useGeneratedKeys="true" keyProperty="id">
insert into jarvis_tg_scalper_phone
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="phone != null and phone != ''">phone,</if>
<if test="phones != null and phones != ''">phones,</if>
<if test="remark != null">remark,</if>
<if test="status != null">status,</if>
create_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="phone != null and phone != ''">#{phone},</if>
<if test="phones != null and phones != ''">#{phones},</if>
<if test="remark != null">#{remark},</if>
<if test="status != null">#{status},</if>
sysdate(),
@@ -64,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateTgScalperPhone" parameterType="TgScalperPhone">
update jarvis_tg_scalper_phone
<trim prefix="SET" suffixOverrides=",">
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="phones != null and phones != ''">phones = #{phones},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="status != null">status = #{status},</if>
update_time = sysdate(),