feat:平台账号

This commit is contained in:
苏竹红
2025-04-08 15:22:47 +08:00
parent c431754f28
commit c08905399c
29 changed files with 1294 additions and 19 deletions

View File

@@ -0,0 +1,129 @@
<?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.cool.store.mapper.ShopAccountMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopAccountDO">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
<result column="system_name" jdbcType="VARCHAR" property="systemName" />
<result column="account" jdbcType="VARCHAR" property="account" />
<result column="bound_phone" jdbcType="VARCHAR" property="boundPhone" />
<result column="password_salt" jdbcType="VARCHAR" property="passwordSalt" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="status" jdbcType="BIT" property="status" />
<result column="entry_status" jdbcType="TINYINT" property="entryStatus" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="last_sync_time" jdbcType="TIMESTAMP" property="lastSyncTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<!-- 批量新增 -->
<insert id="batchInsert">
INSERT INTO xfsg_shop_account (
shop_id,
system_name,
account,
bound_phone,
password_salt,
password,
status,
entry_status,
last_sync_time,
remark
) VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.shopId},
#{item.systemName},
#{item.account},
#{item.boundPhone},
#{item.passwordSalt},
#{item.password},
#{item.status},
#{item.entryStatus},
#{item.lastSyncTime},
#{item.remark}
)
</foreach>
</insert>
<!-- 根据shopId查询多条数据 -->
<select id="selectByShopId" resultMap="BaseResultMap">
SELECT
id,
shop_id,
system_name,
account,
bound_phone,
password_salt,
password,
status,
entry_status,
create_time,
last_sync_time,
remark
FROM
xfsg_shop_account
WHERE
shop_id = #{shopId}
</select>
<!-- 根据shopId与system_name修改status -->
<update id="updateStatusByShopIdAndSystemName">
UPDATE
xfsg_shop_account
SET
status = #{status,jdbcType=BIT}
WHERE
shop_id = #{shopId}
and system_name in
<foreach close=")" collection="systemNameList" item="systemName" open="(" separator=",">
#{systemName}
</foreach>
</update>
<update id="updateEntryStatusByShopIdAndSystemName">
UPDATE
xfsg_shop_account
SET
entry_status = #{entryStatus,jdbcType=BIT}
WHERE
shop_id = #{shopId}
and system_name in
<foreach close=")" collection="systemNameList" item="systemName" open="(" separator=",">
#{systemName}
</foreach>
</update>
<update id="updateAccountByShopIdAndSystemName">
UPDATE
xfsg_shop_account
SET
account = #{account},
password = #{password},
status = #{status},
WHERE
shop_id = #{shopId}
AND system_name = #{systemName}
</update>
<!-- 批量修改密码和密码盐 -->
<update id="batchUpdatePasswordByShopIds">
UPDATE
xfsg_shop_account
SET
password = #{password},
password_salt = #{passwordSalt},
last_sync_time = #{lastSyncTime,jdbcType=TIMESTAMP}
WHERE
system_name in ('火码POS','云流水','新掌柜')
and shop_id IN
<foreach close=")" collection="shopIds" item="shopId" open="(" separator=",">
#{shopId}
</foreach>
</update>
</mapper>

View File

@@ -173,6 +173,12 @@
from xfsg_shop_info
where store_num = #{storeNum}
</select>
<select id="selectByStoreCode" resultType="com.cool.store.entity.ShopInfoDO">
select
<include refid="allColumn"/>
from xfsg_shop_info
where store_code = #{storeCode}
</select>
<select id="selectShopListByRegionId" resultType="com.cool.store.entity.ShopInfoDO">
select
xsi.id,xsi.line_id as lineId,xsi.region_id as regionId,xsi.shop_name as shopName,xsi.store_num as