feat:平台账号
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user