Blame view

backend/uc/src/main/resources/mapper/MatrixMapper.xml 2.18 KB
8ea9c133   陈威   初始化提交
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?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.hotent.uc.dao.MatrixDao">
	<resultMap id="Matrix" type="com.hotent.uc.model.Matrix">
		<id property="id" column="ID_" jdbcType="VARCHAR"/>
		<result property="code" column="CODE_" jdbcType="VARCHAR"/>
		<result property="name" column="NAME_" jdbcType="VARCHAR"/>
		<result property="typeId" column="TYPE_ID_" jdbcType="VARCHAR"/>
		<result property="typeName" column="TYPE_NAME_" jdbcType="VARCHAR"/>
		<result property="status" column="STATUS_" jdbcType="NUMERIC"/>
		<result property="managerId" column="MANAGER_ID_" jdbcType="VARCHAR"/>
		<result property="managerName" column="MANAGER_NAME_" jdbcType="VARCHAR"/>
		<result property="isDele" column="IS_DELE_" jdbcType="NUMERIC"/>
		<result property="createBy" column="CREATE_BY_" jdbcType="VARCHAR"/>
		<result property="createTime" column="CREATE_TIME_" jdbcType="TIMESTAMP"/>
		<result property="createOrgId" column="CREATE_ORG_ID_" jdbcType="VARCHAR"/>
		<result property="updateBy" column="UPDATE_BY_" jdbcType="VARCHAR"/>
		<result property="updateTime" column="UPDATE_TIME_" jdbcType="TIMESTAMP"/>
		<result property="tenantId" column="TENANT_ID_" jdbcType="VARCHAR"/>
		<result property="enabled" column="ENABLED_" jdbcType="NUMERIC"/>
	</resultMap>
	
	<select id="getByCode" parameterType="java.lang.String" resultMap="Matrix">
		SELECT * FROM uc_matrix
		WHERE 
		CODE_ = #{code}
	</select>
	<select id="isCodeExist" parameterType="java.util.Map" resultType="java.lang.Boolean">
		SELECT CASE WHEN count(1)>0 THEN 1 ELSE 0 END FROM uc_matrix
		WHERE 
		CODE_ = #{code}
		<if test="@com.hotent.base.ognl.Ognl@isNotEmpty(id)">
			AND ID_ != #{id}
		</if>
	</select>
	<update id="deleLogical" parameterType="java.util.Map">
		UPDATE uc_matrix SET 
		IS_DELE_ = 1
		WHERE
		ID_ IN 
		<foreach collection="ids" item="item" open="(" close=")" separator=",">
			#{item}
		</foreach>
	</update>

    <select id="listJson" parameterType="java.util.Map" resultMap="Matrix">
		SELECT distinct m.* FROM uc_matrix m left join uc_matrix_auth auth on m.id_=auth.matrix_id_ ${ew.customSqlSegment}
	</select>
</mapper>