Browse Source

更新sql语句

tags/v2.4.0
xiaoying 1 year ago
parent
commit
a8173c28e2
1 changed files with 10 additions and 5 deletions
  1. +10
    -5
      tuoheng_oidc_admin/src/main/resources/mapper/TenantMapper.xml

+ 10
- 5
tuoheng_oidc_admin/src/main/resources/mapper/TenantMapper.xml View File

@@ -3,8 +3,10 @@
<mapper namespace="com.tuoheng.mapper.TenantMapper">

<insert id="insertTenant" parameterType="com.tuoheng.model.po.TenantPo" keyProperty="id" useGeneratedKeys="true">
INSERT INTO t_tenant (user_id, remark, `code`, `name`,province_code,province_name,city_code,city_name,district_code,district_name)
VALUES (#{userId}, #{remark}, #{code}, #{name},#{provinceCode},#{provinceName},#{cityCode},#{cityName},#{districtCode},#{districtName})
INSERT INTO t_tenant (user_id, remark, `code`, `name`, province_code, province_name, city_code, city_name,
district_code, district_name)
VALUES (#{userId}, #{remark}, #{code}, #{name}, #{provinceCode}, #{provinceName}, #{cityCode}, #{cityName},
#{districtCode}, #{districtName})
</insert>
<update id="updateById" parameterType="com.tuoheng.model.po.TenantPo">
update t_tenant
@@ -15,7 +17,7 @@
<if test="enabled != null">
enabled = #{enabled},
</if>
<if test="provinceCode != null and provinceCode !=''">
<!--<if test="provinceCode != null and provinceCode !=''">
province_code = #{provinceCode},
</if>
<if test="provinceName != null and provinceName !=''">
@@ -32,7 +34,9 @@
</if>
<if test="districtName != null and districtName !=''">
district_name = #{districtName},
</if>
</if>-->
province_code=#{provinceCode},province_name=#{provinceName},city_code =#{cityCode},city_name
=#{cityName},district_code =#{districtCode},district_name =#{districtName}
</set>
where id = #{id}
</update>
@@ -42,7 +46,8 @@
where code = #{code}
</select>
<select id="findList" resultType="com.tuoheng.model.po.TenantPo">
SELECT id, user_id, remark,enabled, code, name,province_code,province_name,city_code,city_name,district_code,district_name
SELECT id, user_id, remark,enabled, code,
name,province_code,province_name,city_code,city_name,district_code,district_name
FROM t_tenant
WHERE enabled = 1
<if test="query.name != null and query.name != ''">

Loading…
Cancel
Save