代码生成XML中存在部分条件id不存在情况
This commit is contained in:
parent
71c5317711
commit
05c348cc2e
|
@ -282,4 +282,11 @@ public class BaseEntity implements Serializable {
|
||||||
this.dataSourceCode = "master";
|
this.dataSourceCode = "master";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getSorts() {
|
||||||
|
return sorts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSorts(Long sorts) {
|
||||||
|
this.sorts = sorts;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.hzya.frame.sys.role.dao.impl.SysRoleDaoImpl">
|
<mapper namespace="com.hzya.frame.sys.role.dao.impl.SysRoleDaoImpl">
|
||||||
|
|
||||||
<resultMap id="get-SysRoleEntity-result" type="com.hzya.frame.sys.role.entity.SysRoleEntity" >
|
<resultMap id="get-SysRoleEntity-result" type="com.hzya.frame.sys.role.entity.SysRoleEntity">
|
||||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||||
<result property="roleCode" column="role_code" jdbcType="VARCHAR"/>
|
<result property="roleCode" column="role_code" jdbcType="VARCHAR"/>
|
||||||
<result property="roleName" column="role_name" jdbcType="VARCHAR"/>
|
<result property="roleName" column="role_name" jdbcType="VARCHAR"/>
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
<result property="companyId" column="company_id" jdbcType="VARCHAR"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<!-- 查询的字段-->
|
<!-- 查询的字段-->
|
||||||
<sql id = "SysRoleEntity_Base_Column_List">
|
<sql id="SysRoleEntity_Base_Column_List">
|
||||||
id
|
id
|
||||||
,role_code
|
,role_code
|
||||||
,role_name
|
,role_name
|
||||||
|
@ -32,148 +32,162 @@
|
||||||
,company_id
|
,company_id
|
||||||
</sql>
|
</sql>
|
||||||
<!-- 查询 采用==查询 -->
|
<!-- 查询 采用==查询 -->
|
||||||
<select id="entity_list_base" resultMap="get-SysRoleEntity-result" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity">
|
<select id="entity_list_base" resultMap="get-SysRoleEntity-result"
|
||||||
|
parameterType="com.hzya.frame.sys.role.entity.SysRoleEntity">
|
||||||
select
|
select
|
||||||
<include refid="SysRoleEntity_Base_Column_List" />
|
<include refid="SysRoleEntity_Base_Column_List"/>
|
||||||
from sys_role
|
from sys_role
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
<if test="roleCode != null and roleCode != ''"> and role_code = #{roleCode} </if>
|
<if test="roleCode != null and roleCode != ''">and role_code = #{roleCode}</if>
|
||||||
<if test="roleName != null and roleName != ''"> and role_name = #{roleName} </if>
|
<if test="roleName != null and roleName != ''">and role_name = #{roleName}</if>
|
||||||
<if test="description != null and description != ''"> and description = #{description} </if>
|
<if test="description != null and description != ''">and description = #{description}</if>
|
||||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询符合条件的数量 -->
|
<!-- 查询符合条件的数量 -->
|
||||||
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity">
|
<select id="entity_count" resultType="Integer" parameterType="com.hzya.frame.sys.role.entity.SysRoleEntity">
|
||||||
select count(1) from sys_role
|
select count(1) from sys_role
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
<if test="roleCode != null and roleCode != ''"> and role_code = #{roleCode} </if>
|
<if test="roleCode != null and roleCode != ''">and role_code = #{roleCode}</if>
|
||||||
<if test="roleName != null and roleName != ''"> and role_name = #{roleName} </if>
|
<if test="roleName != null and roleName != ''">and role_name = #{roleName}</if>
|
||||||
<if test="description != null and description != ''"> and description = #{description} </if>
|
<if test="description != null and description != ''">and description = #{description}</if>
|
||||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id = #{create_user_id} </if>
|
<if test="create_user_id != null and create_user_id != ''">and create_user_id = #{create_user_id}</if>
|
||||||
<if test="create_time != null"> and create_time = #{create_time} </if>
|
<if test="create_time != null">and create_time = #{create_time}</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id = #{modify_user_id} </if>
|
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id = #{modify_user_id}</if>
|
||||||
<if test="modify_time != null"> and modify_time = #{modify_time} </if>
|
<if test="modify_time != null">and modify_time = #{modify_time}</if>
|
||||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||||
<if test="org_id != null and org_id != ''"> and org_id = #{org_id} </if>
|
<if test="org_id != null and org_id != ''">and org_id = #{org_id}</if>
|
||||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
|
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 分页查询列表 采用like格式 -->
|
<!-- 分页查询列表 采用like格式 -->
|
||||||
<select id="entity_list_like" resultMap="get-SysRoleEntity-result" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity">
|
<select id="entity_list_like" resultMap="get-SysRoleEntity-result"
|
||||||
|
parameterType="com.hzya.frame.sys.role.entity.SysRoleEntity">
|
||||||
select
|
select
|
||||||
<include refid="SysRoleEntity_Base_Column_List" />
|
<include refid="SysRoleEntity_Base_Column_List"/>
|
||||||
from sys_role
|
from sys_role
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
|
<if test="id != null and id != ''">and id like concat('%',#{id},'%')</if>
|
||||||
<if test="roleCode != null and roleCode != ''"> and role_code like concat('%',#{roleCode},'%') </if>
|
<if test="roleCode != null and roleCode != ''">and role_code like concat('%',#{roleCode},'%')</if>
|
||||||
<if test="roleName != null and roleName != ''"> and role_name like concat('%',#{roleName},'%') </if>
|
<if test="roleName != null and roleName != ''">and role_name like concat('%',#{roleName},'%')</if>
|
||||||
<if test="description != null and description != ''"> and description like concat('%',#{description},'%') </if>
|
<if test="description != null and description != ''">and description like concat('%',#{description},'%')
|
||||||
<if test="sorts != null"> and sorts like concat('%',#{sorts},'%') </if>
|
</if>
|
||||||
<if test="create_user_id != null and create_user_id != ''"> and create_user_id like concat('%',#{create_user_id},'%') </if>
|
<if test="sorts != null">and sorts like concat('%',#{sorts},'%')</if>
|
||||||
<if test="create_time != null"> and create_time like concat('%',#{create_time},'%') </if>
|
<if test="create_user_id != null and create_user_id != ''">and create_user_id like
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> and modify_user_id like concat('%',#{modify_user_id},'%') </if>
|
concat('%',#{create_user_id},'%')
|
||||||
<if test="modify_time != null"> and modify_time like concat('%',#{modify_time},'%') </if>
|
</if>
|
||||||
<if test="sts != null and sts != ''"> and sts like concat('%',#{sts},'%') </if>
|
<if test="create_time != null">and create_time like concat('%',#{create_time},'%')</if>
|
||||||
<if test="org_id != null and org_id != ''"> and org_id like concat('%',#{org_id},'%') </if>
|
<if test="modify_user_id != null and modify_user_id != ''">and modify_user_id like
|
||||||
<if test="companyId != null and companyId != ''"> and company_id like concat('%',#{companyId},'%') </if>
|
concat('%',#{modify_user_id},'%')
|
||||||
|
</if>
|
||||||
|
<if test="modify_time != null">and modify_time like concat('%',#{modify_time},'%')</if>
|
||||||
|
<if test="sts != null and sts != ''">and sts like concat('%',#{sts},'%')</if>
|
||||||
|
<if test="org_id != null and org_id != ''">and org_id like concat('%',#{org_id},'%')</if>
|
||||||
|
<if test="companyId != null and companyId != ''">and company_id like concat('%',#{companyId},'%')</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询列表 字段采用or格式 -->
|
<!-- 查询列表 字段采用or格式 -->
|
||||||
<select id="SysRoleentity_list_or" resultMap="get-SysRoleEntity-result" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity">
|
<select id="SysRoleentity_list_or" resultMap="get-SysRoleEntity-result"
|
||||||
|
parameterType="com.hzya.frame.sys.role.entity.SysRoleEntity">
|
||||||
select
|
select
|
||||||
<include refid="SysRoleEntity_Base_Column_List" />
|
<include refid="SysRoleEntity_Base_Column_List"/>
|
||||||
from sys_role
|
from sys_role
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''"> or id = #{id} </if>
|
<if test="id != null and id != ''">or id = #{id}</if>
|
||||||
<if test="roleCode != null and roleCode != ''"> or role_code = #{roleCode} </if>
|
<if test="roleCode != null and roleCode != ''">or role_code = #{roleCode}</if>
|
||||||
<if test="roleName != null and roleName != ''"> or role_name = #{roleName} </if>
|
<if test="roleName != null and roleName != ''">or role_name = #{roleName}</if>
|
||||||
<if test="description != null and description != ''"> or description = #{description} </if>
|
<if test="description != null and description != ''">or description = #{description}</if>
|
||||||
<if test="sorts != null"> or sorts = #{sorts} </if>
|
<if test="sorts != null">or sorts = #{sorts}</if>
|
||||||
<if test="create_user_id != null and create_user_id != ''"> or create_user_id = #{create_user_id} </if>
|
<if test="create_user_id != null and create_user_id != ''">or create_user_id = #{create_user_id}</if>
|
||||||
<if test="create_time != null"> or create_time = #{create_time} </if>
|
<if test="create_time != null">or create_time = #{create_time}</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> or modify_user_id = #{modify_user_id} </if>
|
<if test="modify_user_id != null and modify_user_id != ''">or modify_user_id = #{modify_user_id}</if>
|
||||||
<if test="modify_time != null"> or modify_time = #{modify_time} </if>
|
<if test="modify_time != null">or modify_time = #{modify_time}</if>
|
||||||
<if test="sts != null and sts != ''"> or sts = #{sts} </if>
|
<if test="sts != null and sts != ''">or sts = #{sts}</if>
|
||||||
<if test="org_id != null and org_id != ''"> or org_id = #{org_id} </if>
|
<if test="org_id != null and org_id != ''">or org_id = #{org_id}</if>
|
||||||
<if test="companyId != null and companyId != ''"> or company_id = #{companyId} </if>
|
<if test="companyId != null and companyId != ''">or company_id = #{companyId}</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
<if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
|
<if test=" sort == null or sort == ''.toString() ">order by sorts asc</if>
|
||||||
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
<if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--新增所有列-->
|
<!--新增所有列-->
|
||||||
<insert id="entity_insert" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity" keyProperty="" useGeneratedKeys="true">
|
<insert id="entity_insert" parameterType="com.hzya.frame.sys.role.entity.SysRoleEntity" keyProperty=""
|
||||||
|
useGeneratedKeys="true">
|
||||||
insert into sys_role(
|
insert into sys_role(
|
||||||
<trim suffix="" suffixOverrides=",">
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="id != null and id != ''"> id , </if>
|
<if test="id != null and id != ''">id ,</if>
|
||||||
<if test="roleCode != null and roleCode != ''"> role_code , </if>
|
<if test="roleCode != null and roleCode != ''">role_code ,</if>
|
||||||
<if test="roleName != null and roleName != ''"> role_name , </if>
|
<if test="roleName != null and roleName != ''">role_name ,</if>
|
||||||
<if test="description != null and description != ''"> description , </if>
|
<if test="description != null and description != ''">description ,</if>
|
||||||
<if test="sorts != null"> sorts , </if>
|
<if test="sorts != null">sorts ,</if>
|
||||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id , </if>
|
<if test="create_user_id != null and create_user_id != ''">create_user_id ,</if>
|
||||||
<if test="create_time != null"> create_time , </if>
|
<if test="create_time != null">create_time ,</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id , </if>
|
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id ,</if>
|
||||||
<if test="modify_time != null"> modify_time , </if>
|
<if test="modify_time != null">modify_time ,</if>
|
||||||
<if test="sts != null and sts != ''"> sts , </if>
|
<if test="sts != null and sts != ''">sts ,</if>
|
||||||
<if test="org_id != null and org_id != ''"> org_id , </if>
|
<if test="org_id != null and org_id != ''">org_id ,</if>
|
||||||
<if test="companyId != null and companyId != ''"> company_id , </if>
|
<if test="companyId != null and companyId != ''">company_id ,</if>
|
||||||
<if test="sorts == null ">sorts,</if>
|
<if test="sorts == null ">sorts,</if>
|
||||||
<if test="sts == null ">sts,</if>
|
<if test="sts == null ">sts,</if>
|
||||||
</trim>
|
</trim>
|
||||||
)values(
|
)values(
|
||||||
<trim suffix="" suffixOverrides=",">
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="id != null and id != ''"> #{id} ,</if>
|
<if test="id != null and id != ''">#{id} ,</if>
|
||||||
<if test="roleCode != null and roleCode != ''"> #{roleCode} ,</if>
|
<if test="roleCode != null and roleCode != ''">#{roleCode} ,</if>
|
||||||
<if test="roleName != null and roleName != ''"> #{roleName} ,</if>
|
<if test="roleName != null and roleName != ''">#{roleName} ,</if>
|
||||||
<if test="description != null and description != ''"> #{description} ,</if>
|
<if test="description != null and description != ''">#{description} ,</if>
|
||||||
<if test="sorts != null"> #{sorts} ,</if>
|
<if test="sorts != null">#{sorts} ,</if>
|
||||||
<if test="create_user_id != null and create_user_id != ''"> #{create_user_id} ,</if>
|
<if test="create_user_id != null and create_user_id != ''">#{create_user_id} ,</if>
|
||||||
<if test="create_time != null"> #{create_time} ,</if>
|
<if test="create_time != null">#{create_time} ,</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> #{modify_user_id} ,</if>
|
<if test="modify_user_id != null and modify_user_id != ''">#{modify_user_id} ,</if>
|
||||||
<if test="modify_time != null"> #{modify_time} ,</if>
|
<if test="modify_time != null">#{modify_time} ,</if>
|
||||||
<if test="sts != null and sts != ''"> #{sts} ,</if>
|
<if test="sts != null and sts != ''">#{sts} ,</if>
|
||||||
<if test="org_id != null and org_id != ''"> #{org_id} ,</if>
|
<if test="org_id != null and org_id != ''">#{org_id} ,</if>
|
||||||
<if test="companyId != null and companyId != ''"> #{companyId} ,</if>
|
<if test="companyId != null and companyId != ''">#{companyId} ,</if>
|
||||||
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_role a WHERE a.sts = 'Y' ),</if>
|
<if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from sys_role a WHERE a.sts = 'Y'
|
||||||
|
),
|
||||||
|
</if>
|
||||||
<if test="sts == null ">'Y',</if>
|
<if test="sts == null ">'Y',</if>
|
||||||
</trim>
|
</trim>
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<!-- 批量新增 -->
|
<!-- 批量新增 -->
|
||||||
<insert id="entityInsertBatch" keyProperty="" useGeneratedKeys="true">
|
<insert id="entityInsertBatch" keyProperty="" useGeneratedKeys="true">
|
||||||
insert into sys_role(id, role_code, role_name, description, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
|
insert into sys_role(id, role_code, role_name, description, sorts, create_user_id, create_time, modify_user_id,
|
||||||
|
modify_time, sts, org_id, company_id, sts)
|
||||||
values
|
values
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
<foreach collection="entities" item="entity" separator=",">
|
||||||
(#{entity.id},#{entity.roleCode},#{entity.roleName},#{entity.description},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
|
(#{entity.id},#{entity.roleCode},#{entity.roleName},#{entity.description},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},
|
||||||
|
'Y')
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
<!-- 批量新增或者修改-->
|
<!-- 批量新增或者修改-->
|
||||||
<insert id="entityInsertOrUpdateBatch" keyProperty="" useGeneratedKeys="true">
|
<insert id="entityInsertOrUpdateBatch" keyProperty="" useGeneratedKeys="true">
|
||||||
insert into sys_role(id, role_code, role_name, description, sorts, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id)
|
insert into sys_role(id, role_code, role_name, description, sorts, create_user_id, create_time, modify_user_id,
|
||||||
|
modify_time, sts, org_id, company_id)
|
||||||
values
|
values
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
<foreach collection="entities" item="entity" separator=",">
|
||||||
(#{entity.id},#{entity.roleCode},#{entity.roleName},#{entity.description},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
(#{entity.id},#{entity.roleCode},#{entity.roleName},#{entity.description},#{entity.sorts},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId})
|
||||||
|
@ -190,48 +204,49 @@
|
||||||
modify_time = values(modify_time),
|
modify_time = values(modify_time),
|
||||||
sts = values(sts),
|
sts = values(sts),
|
||||||
org_id = values(org_id),
|
org_id = values(org_id),
|
||||||
company_id = values(company_id)</insert>
|
company_id = values(company_id)
|
||||||
<!--通过主键修改方法-->
|
</insert>
|
||||||
<update id="entity_update" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity" >
|
<!--通过主键修改方法-->
|
||||||
update sys_role set
|
<update id="entity_update" parameterType="com.hzya.frame.sys.role.entity.SysRoleEntity">
|
||||||
<trim suffix="" suffixOverrides=",">
|
update sys_role set
|
||||||
<if test="id != null and id != ''"> id = #{id},</if>
|
<trim suffix="" suffixOverrides=",">
|
||||||
<if test="roleCode != null and roleCode != ''"> role_code = #{roleCode},</if>
|
<if test="id != null and id != ''">id = #{id},</if>
|
||||||
<if test="roleName != null and roleName != ''"> role_name = #{roleName},</if>
|
<if test="roleCode != null and roleCode != ''">role_code = #{roleCode},</if>
|
||||||
<if test="description != null and description != ''"> description = #{description},</if>
|
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
||||||
<if test="sorts != null"> sorts = #{sorts},</if>
|
<if test="description != null and description != ''">description = #{description},</if>
|
||||||
<if test="create_user_id != null and create_user_id != ''"> create_user_id = #{create_user_id},</if>
|
<if test="sorts != null">sorts = #{sorts},</if>
|
||||||
<if test="create_time != null"> create_time = #{create_time},</if>
|
<if test="create_user_id != null and create_user_id != ''">create_user_id = #{create_user_id},</if>
|
||||||
<if test="modify_user_id != null and modify_user_id != ''"> modify_user_id = #{modify_user_id},</if>
|
<if test="create_time != null">create_time = #{create_time},</if>
|
||||||
<if test="modify_time != null"> modify_time = #{modify_time},</if>
|
<if test="modify_user_id != null and modify_user_id != ''">modify_user_id = #{modify_user_id},</if>
|
||||||
<if test="sts != null and sts != ''"> sts = #{sts},</if>
|
<if test="modify_time != null">modify_time = #{modify_time},</if>
|
||||||
<if test="org_id != null and org_id != ''"> org_id = #{org_id},</if>
|
<if test="sts != null and sts != ''">sts = #{sts},</if>
|
||||||
<if test="companyId != null and companyId != ''"> company_id = #{companyId},</if>
|
<if test="org_id != null and org_id != ''">org_id = #{org_id},</if>
|
||||||
</trim>
|
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||||
where = #{}
|
</trim>
|
||||||
</update>
|
where = #{id}
|
||||||
<!-- 逻辑删除 -->
|
</update>
|
||||||
<update id="entity_logicDelete" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity" >
|
<!-- 逻辑删除 -->
|
||||||
|
<update id="entity_logicDelete" parameterType="com.hzya.frame.sys.role.entity.SysRoleEntity">
|
||||||
update sys_role set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
update sys_role set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||||
where = #{}
|
where = #{id}
|
||||||
</update>
|
</update>
|
||||||
<!-- 多条件逻辑删除 -->
|
<!-- 多条件逻辑删除 -->
|
||||||
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.sys.role.entity.SysRoleEntity" >
|
<update id="entity_logicDelete_Multi_Condition" parameterType="com.hzya.frame.sys.role.entity.SysRoleEntity">
|
||||||
update sys_role set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
update sys_role set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
|
||||||
<trim prefix="where" prefixOverrides="and">
|
<trim prefix="where" prefixOverrides="and">
|
||||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
<if test="id != null and id != ''">and id = #{id}</if>
|
||||||
<if test="roleCode != null and roleCode != ''"> and role_code = #{roleCode} </if>
|
<if test="roleCode != null and roleCode != ''">and role_code = #{roleCode}</if>
|
||||||
<if test="roleName != null and roleName != ''"> and role_name = #{roleName} </if>
|
<if test="roleName != null and roleName != ''">and role_name = #{roleName}</if>
|
||||||
<if test="description != null and description != ''"> and description = #{description} </if>
|
<if test="description != null and description != ''">and description = #{description}</if>
|
||||||
<if test="sorts != null"> and sorts = #{sorts} </if>
|
<if test="sorts != null">and sorts = #{sorts}</if>
|
||||||
<if test="sts != null and sts != ''"> and sts = #{sts} </if>
|
<if test="sts != null and sts != ''">and sts = #{sts}</if>
|
||||||
<if test="companyId != null and companyId != ''"> and company_id = #{companyId} </if>
|
<if test="companyId != null and companyId != ''">and company_id = #{companyId}</if>
|
||||||
and sts='Y'
|
and sts='Y'
|
||||||
</trim>
|
</trim>
|
||||||
</update>
|
</update>
|
||||||
<!--通过主键删除-->
|
<!--通过主键删除-->
|
||||||
<delete id="entity_delete">
|
<delete id="entity_delete">
|
||||||
delete from sys_role where = #{}
|
delete from sys_role where = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue