@ -21,6 +21,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
@@ -21,6 +21,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property= "detailCode" column= "detail_code" />
<result property= "detailName" column= "detail_name" />
</resultMap>
<resultMap type= "DhcDataAuth" id= "DhcDataAuthResults" >
<result property= "dataAuthId" column= "data_auth_id" />
<result property= "userId" column= "user_id" />
<result property= "deptId" column= "dept_id" />
<result property= "authNode" column= "auth_node" />
<result property= "productLineCode" column= "product_line_code" />
<result property= "areaType" column= "area_type" />
<result property= "deptAllId" column= "dept_all_id" />
<result property= "deptAllName" column= "dept_all_Name" />
<result property= "userName" column= "user_name" />
<result property= "nickName" column= "nick_name" />
<result property= "phonenumber" column= "phonenumber" />
<result property= "areaCode" column= "areaCode" />
<result property= "areaName" column= "areaName" />
</resultMap>
<sql id= "selectDhcDataAuthVo" >
select data_auth_id, user_id, dept_id, auth_node, product_line_code, area_type,b.dept_all_id,dept_all_Name from dhc_data_auth
@ -93,12 +108,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
@@ -93,12 +108,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<where >
<if test= "dataAuthId != null " > and data_auth_id = #{dataAuthId}</if>
<if test= "detailType != null and detailType != ''" > and detail_type = #{detailType}</if>
<if test= "detailList != null and detailList.size() > 0" >
and detail_code in
<foreach item= "detailCode" collection= "detailList" open= "(" separator= "," close= ")" >
#{detailCode}
</foreach>
</if>
<if test= "dataAuthIds != null and dataAuthIds.size() > 0" >
and data_auth_id in
<foreach item= "dataAuthId" collection= "dataAuthIds" open= "(" separator= "," close= ")" >
@ -116,4 +125,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
@@ -116,4 +125,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id= "selectDhcDataAuthDetailList" parameterType= "DhcDataAuth" resultMap= "DhcDataAuthDetailResult" >
select detail_code,detail_name from dhc_data_auth_detail where data_auth_id = #{dataAuthId} and detail_type = #{detailType}
</select>
<select id= "selectDhcDataAuthByPage" parameterType= "DhcDataAuth" resultMap= "DhcDataAuthResults" >
SELECT
a.data_auth_id,
a.user_id,
a.dept_id,
a.auth_node,
a.product_line_code,
a.area_type,
a.dept_all_id,
a.dept_all_Name,
b.user_name,
b.nick_name,
b.phonenumber,
c.detail_code AS areaCode,
c.detail_name AS AreaName
FROM
dhc_data_auth a
JOIN sys_user b ON a.user_id = b.user_id
JOIN dhc_data_auth_detail c ON c.data_auth_id = c.data_auth_id
<where >
<if test= "userId != null " > and a.user_id = #{userId}</if>
<if test= "deptId != null " > and a.dept_id = #{deptId}</if>
<if test= "authNode != null and authNode != ''" > and a.auth_node = #{authNode}</if>
<if test= "productLineCode != null and productLineCode != ''" > and a.product_line_code = #{productLineCode}</if>
<if test= "areaType != null and areaType != ''" > and a.area_type = #{areaType}</if>
<if test= "userName != null and userName != ''" >
AND b.user_name like concat('%', #{userName}, '%')
</if>
<if test= "nickName != null and nickName != ''" >
AND b.nick_name like concat('%', #{nickName}, '%')
</if>
<if test= "phonenumber != null and phonenumber != ''" >
AND b.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<if test= "detailCodes != null and detailCodes.size() > 0" >
and c.detail_code in
<foreach item= "detailCode" collection= "detailCodes" open= "(" separator= "," close= ")" >
#{detailCode}
</foreach>
</if>
</where>
</select>
<delete id= "deleteDataAuthDetail" parameterType= "DhcDataAuthDetail" >
delete from dhc_data_auth_detail where data_auth_id = #{dataAuthId} and detail_code = #{detailCode} and detail_type = #{detailType}
</delete>
<select id= "selectDataAuthDetailCount" parameterType= "DhcDataAuthDetail" resultType= "integer" >
select count(1) from dhc_data_auth_detail where data_auth_id = #{dataAuthId} and detail_type = #{detailType}
</select>
</mapper>