12 changed files with 170 additions and 18 deletions
@ -0,0 +1,70 @@ |
|||
<?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.qs.serve.modules.qms.mapper.QmsGroupScopeMapper"> |
|||
|
|||
<resultMap id="qmsGroupScopeMap" type="com.qs.serve.modules.qms.entity.QmsGroupScope" > |
|||
<result property="id" column="id"/> |
|||
<result property="groupId" column="group_id"/> |
|||
<result property="scopeType" column="scope_type"/> |
|||
<result property="scopeValue" column="scope_value"/> |
|||
<result property="finished" column="finished"/> |
|||
<result property="delFlag" column="del_flag"/> |
|||
<result property="createTime" column="create_time"/> |
|||
<result property="createBy" column="create_by"/> |
|||
<result property="updateTime" column="update_time"/> |
|||
<result property="updateBy" column="update_by"/> |
|||
</resultMap> |
|||
|
|||
<sql id="qmsGroupScopeSql"> |
|||
qms_group_scope.`id`, |
|||
qms_group_scope.`group_id`, |
|||
qms_group_scope.`scope_type`, |
|||
qms_group_scope.`scope_value`, |
|||
qms_group_scope.`finished`, |
|||
qms_group_scope.`del_flag`, |
|||
qms_group_scope.`tenant_id`, |
|||
qms_group_scope.`create_time`, |
|||
qms_group_scope.`create_by`, |
|||
qms_group_scope.`update_time`, |
|||
qms_group_scope.`update_by` </sql> |
|||
|
|||
<select id="selectQmsGroupScopeList" parameterType="com.qs.serve.modules.qms.entity.QmsGroupScope" resultMap="qmsGroupScopeMap"> |
|||
SELECT <include refid="qmsGroupScopeSql"/> FROM `qms_group_scope` `qms_group_scope` |
|||
<where> |
|||
<if test="query.id != null"> and `qms_group_scope`.`id` = #{query.id}</if> |
|||
<if test="query.groupId != null"> and `qms_group_scope`.`group_id` = #{query.groupId}</if> |
|||
<if test="query.scopeType != null"> and `qms_group_scope`.`scope_type` = #{query.scopeType}</if> |
|||
<if test="query.scopeValue != null and query.scopeValue != ''"> and `qms_group_scope`.`scope_value` = #{query.scopeValue}</if> |
|||
<if test="query.finished != null"> and `qms_group_scope`.`finished` = #{query.finished}</if> |
|||
<if test="query.delFlag != null"> and `qms_group_scope`.`del_flag` = #{query.delFlag}</if> |
|||
<if test="query.tenantId != null and query.tenantId != ''"> and `qms_group_scope`.`tenant_id` = #{query.tenantId}</if> |
|||
<if test="query.createTime != null"> and `qms_group_scope`.`create_time` = #{query.createTime}</if> |
|||
<if test="query.createBy != null and query.createBy != ''"> and `qms_group_scope`.`create_by` = #{query.createBy}</if> |
|||
<if test="query.updateTime != null"> and `qms_group_scope`.`update_time` = #{query.updateTime}</if> |
|||
<if test="query.updateBy != null and query.updateBy != ''"> and `qms_group_scope`.`update_by` = #{query.updateBy}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="listScope" resultType="com.qs.serve.modules.qms.entity.QmsGroupScope"> |
|||
SELECT <include refid="qmsGroupScopeSql"/> |
|||
FROM `qms_group_scope` `qms_group_scope` |
|||
left join `qms_group` `qms_group` on `qms_group`.`id` = `qms_group_scope`.`group_id` |
|||
<where> |
|||
`qms_group_scope`.`scope_type` in (1,3,4) |
|||
and `qms_group_scope`.`scope_value` = #{userId} |
|||
and `qms_group_scope`.`del_flag` = '0' |
|||
and `qms_group`.`del_flag` = '0' |
|||
<if test="finished == null"> and `qms_group_scope`.`finished` != -1 </if> |
|||
<if test="finished != null and finished == 0 "> |
|||
and `qms_group_scope`.`finished` = '0' and `qms_group`.`group_finished` = '0' |
|||
</if> |
|||
<if test="finished != null and finished == 1 "> |
|||
and (`qms_group_scope`.`finished` = '1' or `qms_group`.`group_finished` = '1') |
|||
</if> |
|||
</where> |
|||
order by `qms_group_scope`.`create_time` desc |
|||
</select> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue