|
|
|
@ -11,21 +11,21 @@
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<resultMap id="res" type="${basePackage}.module.system.ent.Res">
|
|
|
|
|
<result column="ID" jdbcType="BIGINT" property="id"/>
|
|
|
|
|
<result column="RES_CODE" jdbcType="VARCHAR" property="resCode"/>
|
|
|
|
|
<result column="RES_NAME" jdbcType="VARCHAR" property="resName"/>
|
|
|
|
|
<result column="RES_TYPE" jdbcType="VARCHAR" property="resType"/>
|
|
|
|
|
<result column="RES_VALUE" jdbcType="VARCHAR" property="resValue"/>
|
|
|
|
|
<result column="SUP_CODE" jdbcType="VARCHAR" property="supCode"/>
|
|
|
|
|
<result column="SUP_NAME" jdbcType="VARCHAR" property="supName"/>
|
|
|
|
|
<result column="FREE" jdbcType="BIT" property="free"/>
|
|
|
|
|
<result column="VALID" jdbcType="BIT" property="valid"/>
|
|
|
|
|
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
|
|
|
|
|
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
|
|
|
|
|
<result column="CREATE_BY" jdbcType="BIGINT" property="createBy"/>
|
|
|
|
|
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
|
|
<result column="LAST_UPDATE_BY" jdbcType="BIGINT" property="lastUpdateBy"/>
|
|
|
|
|
<result column="LAST_UPDATE_TIME" jdbcType="TIMESTAMP" property="lastUpdateTime"/>
|
|
|
|
|
<result column="ID" jdbcType="BIGINT" property="id"/>
|
|
|
|
|
<result column="RES_CODE" jdbcType="VARCHAR" property="resCode"/>
|
|
|
|
|
<result column="RES_NAME" jdbcType="VARCHAR" property="resName"/>
|
|
|
|
|
<result column="RES_TYPE" jdbcType="VARCHAR" property="resType"/>
|
|
|
|
|
<result column="RES_VALUE" jdbcType="VARCHAR" property="resValue"/>
|
|
|
|
|
<result column="SUP_CODE" jdbcType="VARCHAR" property="supCode"/>
|
|
|
|
|
<result column="SUP_NAME" jdbcType="VARCHAR" property="supName"/>
|
|
|
|
|
<result column="FREE" jdbcType="BIT" property="free"/>
|
|
|
|
|
<result column="VALID" jdbcType="BIT" property="valid"/>
|
|
|
|
|
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
|
|
|
|
|
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
|
|
|
|
|
<result column="CREATE_BY" jdbcType="BIGINT" property="createBy"/>
|
|
|
|
|
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
|
|
<result column="LAST_UPDATE_BY" jdbcType="BIGINT" property="lastUpdateBy"/>
|
|
|
|
|
<result column="LAST_UPDATE_TIME" jdbcType="TIMESTAMP" property="lastUpdateTime"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<select id="find" resultMap="res">
|
|
|
|
@ -70,20 +70,25 @@
|
|
|
|
|
"IS_DELETED" = 0
|
|
|
|
|
<if test="request.userId != null">
|
|
|
|
|
AND "ID" IN (
|
|
|
|
|
SELECT
|
|
|
|
|
t2.RES_ID
|
|
|
|
|
FROM
|
|
|
|
|
"SYS_USER_ROLE" t1,
|
|
|
|
|
"SYS_ROLE_RES" t2
|
|
|
|
|
SELECT t2.RES_ID
|
|
|
|
|
FROM "SYS_USER_ROLE" t1, "SYS_ROLE_RES" t2
|
|
|
|
|
WHERE t1.ROLE_ID = t2.ROLE_ID
|
|
|
|
|
AND t1.IS_DELETED = '0'
|
|
|
|
|
AND t2.IS_DELETED = '0'
|
|
|
|
|
AND t1.USER_ID = ${r'#'}{request.userId}
|
|
|
|
|
AND t1.USER_ID = ${r"#"}{request.userId}
|
|
|
|
|
|
|
|
|
|
UNION
|
|
|
|
|
|
|
|
|
|
SELECT "ID" FROM "SYS_RES" WHERE IS_DELETED = '0' AND "FREE" = '1'
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="request.roleId != null">
|
|
|
|
|
AND "ID" IN (
|
|
|
|
|
SELECT RES_ID FROM "SYS_ROLE_RES" WHERE ROLE_ID = ${r'#'}{request.roleId}
|
|
|
|
|
SELECT RES_ID FROM "SYS_ROLE_RES" WHERE ROLE_ID = ${r"#"}{request.roleId}
|
|
|
|
|
|
|
|
|
|
UNION
|
|
|
|
|
|
|
|
|
|
SELECT "ID" FROM "SYS_RES" WHERE IS_DELETED = '0' AND "FREE" = '1'
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
@ -133,25 +138,25 @@
|
|
|
|
|
<include refid="entityColumnList"/>
|
|
|
|
|
)
|
|
|
|
|
VALUES
|
|
|
|
|
<foreach collection="list" item= "item" index ="index" separator=",">
|
|
|
|
|
(
|
|
|
|
|
${r"#"}{item.id},
|
|
|
|
|
${r"#"}{item.resCode,jdbcType=VARCHAR},
|
|
|
|
|
${r"#"}{item.resName,jdbcType=VARCHAR},
|
|
|
|
|
${r"#"}{item.resType,jdbcType=VARCHAR},
|
|
|
|
|
${r"#"}{item.resValue,jdbcType=VARCHAR},
|
|
|
|
|
${r"#"}{item.supCode,jdbcType=VARCHAR},
|
|
|
|
|
${r"#"}{item.supName,jdbcType=VARCHAR},
|
|
|
|
|
${r"#"}{item.free,jdbcType=BIT},
|
|
|
|
|
${r"#"}{item.valid,jdbcType=BIT},
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
|
${r"#"}{token.userId,jdbcType=NUMERIC},
|
|
|
|
|
datetime('now','localtime'),
|
|
|
|
|
NULL,
|
|
|
|
|
NULL
|
|
|
|
|
)
|
|
|
|
|
</foreach >
|
|
|
|
|
<foreach collection="list" item="item" index="index" separator=",">
|
|
|
|
|
(
|
|
|
|
|
${r"#"}{item.id},
|
|
|
|
|
${r"#"}{item.resCode,jdbcType=VARCHAR},
|
|
|
|
|
${r"#"}{item.resName,jdbcType=VARCHAR},
|
|
|
|
|
${r"#"}{item.resType,jdbcType=VARCHAR},
|
|
|
|
|
${r"#"}{item.resValue,jdbcType=VARCHAR},
|
|
|
|
|
${r"#"}{item.supCode,jdbcType=VARCHAR},
|
|
|
|
|
${r"#"}{item.supName,jdbcType=VARCHAR},
|
|
|
|
|
${r"#"}{item.free,jdbcType=BIT},
|
|
|
|
|
${r"#"}{item.valid,jdbcType=BIT},
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
|
${r"#"}{token.userId,jdbcType=NUMERIC},
|
|
|
|
|
datetime('now','localtime'),
|
|
|
|
|
NULL,
|
|
|
|
|
NULL
|
|
|
|
|
)
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="delete">
|
|
|
|
|