提交 ca55d51d 编写于 作者: 偏锋书生's avatar 偏锋书生

修复自定义SQL无法查询问题

上级 8b132b78
......@@ -17,26 +17,34 @@ import net.wicp.tams.app.duckula.controller.bean.models.SysRoleExample;
public interface SysRoleMapper extends BaseMapper<SysRole> {
/**
* This method was generated by MyBatis Generator. This method corresponds to the database table sys_role
* This method was generated by MyBatis Generator. This method corresponds to
* the database table sys_role
*
* @mbg.generated
*/
long countByExample(SysRoleExample example);
/**
* This method was generated by MyBatis Generator. This method corresponds to the database table sys_role
* This method was generated by MyBatis Generator. This method corresponds to
* the database table sys_role
*
* @mbg.generated
*/
int deleteByExample(SysRoleExample example);
/**
* This method was generated by MyBatis Generator. This method corresponds to the database table sys_role
* This method was generated by MyBatis Generator. This method corresponds to
* the database table sys_role
*
* @mbg.generated
*/
@Delete({ "delete from sys_role", "where id = #{id,jdbcType=BIGINT}" })
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator. This method corresponds to the database table sys_role
* This method was generated by MyBatis Generator. This method corresponds to
* the database table sys_role
*
* @mbg.generated
*/
@Insert({ "insert into sys_role (id, name, ", "status, remark, ", "tenant_id)",
......@@ -45,19 +53,25 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
int insert(SysRole record);
/**
* This method was generated by MyBatis Generator. This method corresponds to the database table sys_role
* This method was generated by MyBatis Generator. This method corresponds to
* the database table sys_role
*
* @mbg.generated
*/
int insertSelective(SysRole record);
/**
* This method was generated by MyBatis Generator. This method corresponds to the database table sys_role
* This method was generated by MyBatis Generator. This method corresponds to
* the database table sys_role
*
* @mbg.generated
*/
List<SysRole> selectByExample(SysRoleExample example);
/**
* This method was generated by MyBatis Generator. This method corresponds to the database table sys_role
* This method was generated by MyBatis Generator. This method corresponds to
* the database table sys_role
*
* @mbg.generated
*/
@Select({ "select", "id, name, status, remark, tenant_id", "from sys_role", "where id = #{id,jdbcType=BIGINT}" })
......@@ -65,25 +79,33 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
SysRole selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator. This method corresponds to the database table sys_role
* This method was generated by MyBatis Generator. This method corresponds to
* the database table sys_role
*
* @mbg.generated
*/
int updateByExampleSelective(@Param("record") SysRole record, @Param("example") SysRoleExample example);
/**
* This method was generated by MyBatis Generator. This method corresponds to the database table sys_role
* This method was generated by MyBatis Generator. This method corresponds to
* the database table sys_role
*
* @mbg.generated
*/
int updateByExample(@Param("record") SysRole record, @Param("example") SysRoleExample example);
/**
* This method was generated by MyBatis Generator. This method corresponds to the database table sys_role
* This method was generated by MyBatis Generator. This method corresponds to
* the database table sys_role
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(SysRole record);
/**
* This method was generated by MyBatis Generator. This method corresponds to the database table sys_role
* This method was generated by MyBatis Generator. This method corresponds to
* the database table sys_role
*
* @mbg.generated
*/
@Update({ "update sys_role", "set name = #{name,jdbcType=VARCHAR},", "status = #{status,jdbcType=VARCHAR},",
......@@ -92,11 +114,14 @@ public interface SysRoleMapper extends BaseMapper<SysRole> {
int updateByPrimaryKey(SysRole record);
/***
* 自定义
* 自定义,如果没有加tenant_id字段而又在po里出现tenatnId会报错:Could not process result for mapping:
* ResultMapping{property='null', column='tenant_id'
*
* @param assignValue
* @return
*/
@Select({ "select", "cr.id, cr.name, cr.status, cr.remark", "from sys_role cr,sys_role_assign ca", "where cr.id=ca.role_id and ca.assign_type='STAFF' and ca.assign_value= #{staffId,jdbcType=BIGINT}" })
@Select({ "select", "cr.id, cr.name, cr.status, cr.remark,cr.tenant_id", "from sys_role cr,sys_role_assign ca",
"where cr.id=ca.role_id and ca.assign_type='STAFF' and ca.assign_value= #{staffId,jdbcType=BIGINT}" })
@ResultMap("net.wicp.tams.app.duckula.controller.dao.SysRoleMapper.BaseResultMap")
List<SysRole> findRolesByStaff(long staffId);
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册