no message
This commit is contained in:
119
src/main/resources/mapper/BaseUserMapper.xml
Normal file
119
src/main/resources/mapper/BaseUserMapper.xml
Normal file
@ -0,0 +1,119 @@
|
||||
<?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.sczx.sync.mapper.BaseUserMapper">
|
||||
|
||||
<!-- 通用查询结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="com.sczx.sync.po.BaseUser">
|
||||
<id column="id" property="id"/>
|
||||
<result column="user_name" property="userName"/>
|
||||
<result column="avatar_url" property="avatarUrl"/>
|
||||
<result column="password" property="password"/>
|
||||
<result column="phone_number" property="phoneNumber"/>
|
||||
<result column="role_id" property="roleId"/>
|
||||
<result column="is_store" property="isStore"/>
|
||||
<result column="nick_name" property="nickName"/>
|
||||
<result column="wechat_openid" property="wechatOpenid"/>
|
||||
<result column="operator_id" property="operatorId"/>
|
||||
<result column="store_id" property="storeId"/>
|
||||
<result column="alipay_userid" property="alipayUserid"/>
|
||||
<result column="authed" property="authed"/>
|
||||
<result column="id_no" property="idNo"/>
|
||||
<result column="real_name" property="realName"/>
|
||||
<result column="front_photo" property="frontPhoto"/>
|
||||
<result column="back_photo" property="backPhoto"/>
|
||||
<result column="del_flag" property="delFlag"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id, user_name, avatar_url, phone_number, role_id, is_store, nick_name,id_no
|
||||
</sql>
|
||||
|
||||
<select id="selectByPhoneNumber" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM zc_base_user
|
||||
WHERE phone_number = #{phoneNumber}
|
||||
AND del_flag = 0
|
||||
</select>
|
||||
|
||||
<!-- 选择性插入用户信息 -->
|
||||
<insert id="insertBaseUser" parameterType="com.sczx.sync.po.BaseUser" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO zc_base_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="avatarUrl != null">avatar_url,</if>
|
||||
<if test="password != null">password,</if>
|
||||
<if test="phoneNumber != null">phone_number,</if>
|
||||
<if test="roleId != null">role_id,</if>
|
||||
<if test="isStore != null">is_store,</if>
|
||||
<if test="nickName != null">nick_name,</if>
|
||||
<if test="wechatOpenid != null">wechat_openid,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="storeId != null">store_id,</if>
|
||||
<if test="alipayUserid != null">alipay_userid,</if>
|
||||
<if test="authed != null">authed,</if>
|
||||
<if test="idNo != null">id_no,</if>
|
||||
<if test="realName != null">real_name,</if>
|
||||
<if test="frontPhoto != null">front_photo,</if>
|
||||
<if test="backPhoto != null">back_photo,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
create_time,
|
||||
update_time,
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="avatarUrl != null">#{avatarUrl},</if>
|
||||
<if test="password != null">#{password},</if>
|
||||
<if test="phoneNumber != null">#{phoneNumber},</if>
|
||||
<if test="roleId != null">#{roleId},</if>
|
||||
<if test="isStore != null">#{isStore},</if>
|
||||
<if test="nickName != null">#{nickName},</if>
|
||||
<if test="wechatOpenid != null">#{wechatOpenid},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="storeId != null">#{storeId},</if>
|
||||
<if test="alipayUserid != null">#{alipayUserid},</if>
|
||||
<if test="authed != null">#{authed},</if>
|
||||
<if test="idNo != null">#{idNo},</if>
|
||||
<if test="realName != null">#{realName},</if>
|
||||
<if test="frontPhoto != null">#{frontPhoto},</if>
|
||||
<if test="backPhoto != null">#{backPhoto},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
NOW(),
|
||||
NOW(),
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 根据手机号更新用户信息 -->
|
||||
<update id="updateByPhoneNumber" parameterType="com.sczx.sync.po.BaseUser">
|
||||
<selectKey keyProperty='id' resultType='java.lang.Long' order='AFTER'>
|
||||
SELECT
|
||||
id
|
||||
from zc_base_user
|
||||
where phone_number = #{phoneNumber}
|
||||
</selectKey>
|
||||
UPDATE zc_base_user
|
||||
<set>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="avatarUrl != null">avatar_url = #{avatarUrl},</if>
|
||||
<if test="password != null">password = #{password},</if>
|
||||
<if test="roleId != null">role_id = #{roleId},</if>
|
||||
<if test="isStore != null">is_store = #{isStore},</if>
|
||||
<if test="nickName != null">nick_name = #{nickName},</if>
|
||||
<if test="wechatOpenid != null">wechat_openid = #{wechatOpenid},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="storeId != null">store_id = #{storeId},</if>
|
||||
<if test="alipayUserid != null">alipay_userid = #{alipayUserid},</if>
|
||||
<if test="authed != null">authed = #{authed},</if>
|
||||
<if test="idNo != null">id_no = #{idNo},</if>
|
||||
<if test="realName != null">real_name = #{realName},</if>
|
||||
<if test="frontPhoto != null">front_photo = #{frontPhoto},</if>
|
||||
<if test="backPhoto != null">back_photo = #{backPhoto},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
update_time = NOW(),
|
||||
</set>
|
||||
WHERE phone_number = #{phoneNumber}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sczx.sync.mapper.BatteryMealMapper">
|
||||
|
||||
<insert id="insertZcRentBatteyRule" parameterType="SyncDataInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
<insert id="insertZcRentBatteyRule" parameterType="BatteryRule" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into zc_rent_battey_rule
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null and title != ''">title,</if>
|
||||
@ -38,7 +38,7 @@
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBatteryRule" parameterType="SyncDataInfo">
|
||||
<update id="updateBatteryRule" parameterType="BatteryRule">
|
||||
update zc_rent_battey_rule
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="title != null and title != ''">title = #{title},</if>
|
||||
|
||||
143
src/main/resources/mapper/CompanyInfoMapper.xml
Normal file
143
src/main/resources/mapper/CompanyInfoMapper.xml
Normal file
@ -0,0 +1,143 @@
|
||||
<?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.sczx.sync.mapper.CompanyInfoMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.sczx.sync.po.CompanyInfo">
|
||||
<result column="company_name" property="companyName" />
|
||||
<result column="contact_name" property="contactName" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="address" property="address" />
|
||||
<result column="citys" property="citys" />
|
||||
<result column="is_delete" property="isDelete" />
|
||||
<result column="b_op_id" property="bOpId" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
b_op_id, company_name, contact_name, phone, address, citys, is_delete
|
||||
</sql>
|
||||
|
||||
<!-- 根据电话号码查询公司信息 -->
|
||||
<select id="selectByPhone" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM zc_company
|
||||
WHERE phone = #{phone}
|
||||
AND is_delete = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据bOpId查询公司信息 -->
|
||||
<select id="selectByOpId" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM zc_company
|
||||
WHERE b_op_id = #{bOpId}
|
||||
AND is_delete = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据公司名称查询公司信息 -->
|
||||
<select id="selectByCompanyName" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM zc_company
|
||||
WHERE company_name = #{companyName}
|
||||
AND is_delete = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据电话号码更新公司信息 -->
|
||||
<update id="updateByPhone" parameterType="com.sczx.sync.po.CompanyInfo" >
|
||||
<selectKey keyProperty='id' resultType='java.lang.Long' order='AFTER'>
|
||||
SELECT
|
||||
id
|
||||
from zc_company
|
||||
where phone = #{phone}
|
||||
</selectKey>
|
||||
UPDATE zc_company
|
||||
<set>
|
||||
<if test="companyName != null and companyName != ''">
|
||||
company_name = #{companyName},
|
||||
</if>
|
||||
<if test="contactName != null and contactName != ''">
|
||||
contact_name = #{contactName},
|
||||
</if>
|
||||
<if test="address != null and address != ''">
|
||||
address = #{address},
|
||||
</if>
|
||||
<if test="citys != null and citys != ''">
|
||||
citys = #{citys},
|
||||
</if>
|
||||
<if test="isDelete != null">
|
||||
is_delete = #{isDelete},
|
||||
</if>
|
||||
<if test="bOpId != null">
|
||||
b_op_id = #{bOpId},
|
||||
</if>
|
||||
phone = #{phone}
|
||||
</set>
|
||||
WHERE phone = #{phone}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据电话号码更新公司信息 -->
|
||||
<update id="updateByOpId" parameterType="com.sczx.sync.po.CompanyInfo">
|
||||
<selectKey keyProperty='id' resultType='java.lang.Long' order='AFTER'>
|
||||
SELECT
|
||||
id
|
||||
from zc_company
|
||||
where phone = #{phone}
|
||||
</selectKey>
|
||||
UPDATE zc_company
|
||||
<set>
|
||||
<if test="companyName != null and companyName != ''">
|
||||
company_name = #{companyName},
|
||||
</if>
|
||||
<if test="contactName != null and contactName != ''">
|
||||
contact_name = #{contactName},
|
||||
</if>
|
||||
<if test="address != null and address != ''">
|
||||
address = #{address},
|
||||
</if>
|
||||
<if test="citys != null and citys != ''">
|
||||
citys = #{citys},
|
||||
</if>
|
||||
<if test="isDelete != null">
|
||||
is_delete = #{isDelete},
|
||||
</if>
|
||||
<if test="bOpId != null">
|
||||
b_op_id = #{bOpId},
|
||||
</if>
|
||||
phone = #{phone}
|
||||
</set>
|
||||
WHERE b_op_id = #{bOpId}
|
||||
</update>
|
||||
|
||||
<!-- 插入公司信息 -->
|
||||
<insert id="insertCompanyInfo" parameterType="com.sczx.sync.po.CompanyInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO zc_company (
|
||||
b_op_id,
|
||||
company_name,
|
||||
contact_name,
|
||||
phone,
|
||||
address,
|
||||
citys,
|
||||
is_delete,
|
||||
is_add_rules,
|
||||
sharing_ratio,
|
||||
wechat_receiving_account,
|
||||
wechat_key,
|
||||
ali_receiving_account,
|
||||
ali_key
|
||||
) VALUES (
|
||||
#{bOpId},
|
||||
#{companyName},
|
||||
#{contactName},
|
||||
#{phone},
|
||||
#{address},
|
||||
#{citys},
|
||||
#{isDelete},
|
||||
0,0,0,0,0,0
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@ -2,6 +2,171 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.sczx.sync.mapper.CompanyStoreMapper">
|
||||
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.sczx.sync.po.StoreInfo">
|
||||
<result column="name" property="name" />
|
||||
<result column="contact_person" property="contactName" />
|
||||
<result column="phone" property="phone" />
|
||||
<result column="province_id" property="province" />
|
||||
<result column="city_id" property="city" />
|
||||
<result column="area_id" property="area" />
|
||||
<result column="address" property="address" />
|
||||
<result column="image" property="image" />
|
||||
<result column="latitude" property="latitude" />
|
||||
<result column="longitude" property="longitude" />
|
||||
<result column="del_flag" property="isDelete" />
|
||||
<result column="bp_store_id" property="bpStoreId" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
bp_store_id, name, contact_person, phone, province_id, city_id, area_id, address, image, latitude, longitude, del_flag
|
||||
</sql>
|
||||
|
||||
<!-- 根据联系电话查询门店信息 -->
|
||||
<select id="selectByPhone" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM zc_company_store
|
||||
WHERE phone = #{phone}
|
||||
AND del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectByBid" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM zc_company_store
|
||||
WHERE bp_store_id = #{bpStoreId}
|
||||
AND del_flag = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据门店名称更新门店信息 -->
|
||||
<update id="updateByName" parameterType="com.sczx.sync.po.StoreInfo">
|
||||
<selectKey keyProperty='id' resultType='java.lang.Long' order='AFTER'>
|
||||
SELECT
|
||||
id
|
||||
from zc_company_store
|
||||
where name = #{name}
|
||||
</selectKey>
|
||||
UPDATE zc_company_store
|
||||
<set>
|
||||
<if test="contactName != null and contactName != ''">
|
||||
contact_person = #{contactName},
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
phone = #{phone},
|
||||
</if>
|
||||
<if test="province != null and province != ''">
|
||||
province_id = #{province},
|
||||
</if>
|
||||
<if test="city != null and city != ''">
|
||||
city_id = #{city},
|
||||
</if>
|
||||
<if test="area != null and area != ''">
|
||||
area_id = #{area},
|
||||
</if>
|
||||
<if test="address != null and address != ''">
|
||||
address = #{address},
|
||||
</if>
|
||||
<if test="image != null and image != ''">
|
||||
image = #{image},
|
||||
</if>
|
||||
<if test="latitude != null">
|
||||
latitude = #{latitude},
|
||||
</if>
|
||||
<if test="longitude != null">
|
||||
longitude = #{longitude},
|
||||
</if>
|
||||
<if test="isDelete != null">
|
||||
del_flag = #{isDelete},
|
||||
</if>
|
||||
<if test="bpStoreId != null">
|
||||
bp_store_id = #{bpStoreId},
|
||||
</if>
|
||||
</set>
|
||||
WHERE name = #{name}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateByBid" parameterType="com.sczx.sync.po.StoreInfo">
|
||||
<selectKey keyProperty='id' resultType='java.lang.Long' order='AFTER'>
|
||||
SELECT
|
||||
id
|
||||
from zc_company_store
|
||||
where bp_store_id = #{bpStoreId}
|
||||
</selectKey>
|
||||
UPDATE zc_company_store
|
||||
<set>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="contactName != null and contactName != ''">
|
||||
contact_person = #{contactName},
|
||||
</if>
|
||||
<if test="phone != null and phone != ''">
|
||||
phone = #{phone},
|
||||
</if>
|
||||
<if test="province != null and province != ''">
|
||||
province_id = #{province},
|
||||
</if>
|
||||
<if test="city != null and city != ''">
|
||||
city_id = #{city},
|
||||
</if>
|
||||
<if test="area != null and area != ''">
|
||||
area_id = #{area},
|
||||
</if>
|
||||
<if test="address != null and address != ''">
|
||||
address = #{address},
|
||||
</if>
|
||||
<if test="image != null and image != ''">
|
||||
image = #{image},
|
||||
</if>
|
||||
<if test="latitude != null">
|
||||
latitude = #{latitude},
|
||||
</if>
|
||||
<if test="longitude != null">
|
||||
longitude = #{longitude},
|
||||
</if>
|
||||
<if test="isDelete != null">
|
||||
del_flag = #{isDelete},
|
||||
</if>
|
||||
</set>
|
||||
WHERE bp_store_id = #{bpStoreId}
|
||||
</update>
|
||||
|
||||
<!-- 插入门店信息 -->
|
||||
<insert id="insertStoreInfo" parameterType="com.sczx.sync.po.StoreInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO zc_company_store (
|
||||
name,
|
||||
contact_person,
|
||||
phone,
|
||||
province_id,
|
||||
city_id,
|
||||
area_id,
|
||||
address,
|
||||
image,
|
||||
latitude,
|
||||
longitude,
|
||||
del_flag,
|
||||
bp_store_id
|
||||
) VALUES (
|
||||
#{name},
|
||||
#{contactName},
|
||||
#{phone},
|
||||
#{province},
|
||||
#{city},
|
||||
#{area},
|
||||
#{address},
|
||||
#{image},
|
||||
#{latitude},
|
||||
#{longitude},
|
||||
#{isDelete},
|
||||
#{bpStoreId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateStoreId">
|
||||
update zc_company_store set bp_store_id = #{bpStoreId} where id =#{cId}
|
||||
</update>
|
||||
|
||||
67
src/main/resources/mapper/UserStoreMapper.xml
Normal file
67
src/main/resources/mapper/UserStoreMapper.xml
Normal file
@ -0,0 +1,67 @@
|
||||
<?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.sczx.sync.mapper.UserStoreMapper">
|
||||
|
||||
<!-- 通用查询结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="com.sczx.sync.po.UserStore">
|
||||
<id column="id" property="id"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="operator_id" property="operatorId"/>
|
||||
<result column="store_id" property="storeId"/>
|
||||
<result column="del_flag" property="delFlag"/>
|
||||
<result column="create_by" property="createBy"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_by" property="updateBy"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, operator_id, store_id, del_flag, create_by, create_time, update_by, update_time
|
||||
</sql>
|
||||
|
||||
<!-- 根据用户ID查询用户门店信息 -->
|
||||
<select id="selectByUserId" resultMap="BaseResultMap">
|
||||
SELECT <include refid="Base_Column_List"/>
|
||||
FROM zc_base_user_store
|
||||
WHERE user_id = #{userId}
|
||||
AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
<!-- 根据用户ID更新用户门店信息 -->
|
||||
<update id="updateByUserId" parameterType="com.sczx.sync.po.UserStore">
|
||||
UPDATE zc_base_user_store
|
||||
<set>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="storeId != null">store_id = #{storeId},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
update_time = NOW(),
|
||||
</set>
|
||||
WHERE user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<!-- 插入用户门店信息 -->
|
||||
<insert id="insertUserStore" parameterType="com.sczx.sync.po.UserStore">
|
||||
INSERT INTO zc_base_user_store(
|
||||
user_id,
|
||||
operator_id,
|
||||
store_id,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
) VALUES (
|
||||
#{userId},
|
||||
#{operatorId},
|
||||
#{storeId},
|
||||
#{delFlag},
|
||||
#{createBy},
|
||||
NOW(),
|
||||
#{updateBy},
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user