init
This commit is contained in:
BIN
ruoyi-system/src/main/resources/.DS_Store
vendored
Normal file
BIN
ruoyi-system/src/main/resources/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
ruoyi-system/src/main/resources/mapper/.DS_Store
vendored
Normal file
BIN
ruoyi-system/src/main/resources/mapper/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -0,0 +1,66 @@
|
||||
<?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.ruoyi.app.mapper.AppAdRecordMapper">
|
||||
|
||||
<resultMap type="AppAdRecord" id="AppAdRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="integralTime" column="integral_time" />
|
||||
<result property="adType" column="ad_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppAdRecordVo">
|
||||
select id, user_id, integral_time, ad_type from app_ad_record
|
||||
</sql>
|
||||
|
||||
<select id="selectAppAdRecordList" parameterType="AppAdRecord" resultMap="AppAdRecordResult">
|
||||
<include refid="selectAppAdRecordVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="integralTime != null "> and integral_time = #{integralTime}</if>
|
||||
<if test="adType != null "> and ad_type = #{adType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppAdRecordById" parameterType="Long" resultMap="AppAdRecordResult">
|
||||
<include refid="selectAppAdRecordVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppAdRecord" parameterType="AppAdRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_ad_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="integralTime != null">integral_time,</if>
|
||||
<if test="adType != null">ad_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="integralTime != null">#{integralTime},</if>
|
||||
<if test="adType != null">#{adType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppAdRecord" parameterType="AppAdRecord">
|
||||
update app_ad_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="integralTime != null">integral_time = #{integralTime},</if>
|
||||
<if test="adType != null">ad_type = #{adType},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppAdRecordById" parameterType="Long">
|
||||
delete from app_ad_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppAdRecordByIds" parameterType="String">
|
||||
delete from app_ad_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,131 @@
|
||||
<?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.ruoyi.app.mapper.AppBlogArticleMapper">
|
||||
|
||||
<resultMap type="AppBlogArticle" id="AppBlogArticleResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="contentInfo" column="content_info" />
|
||||
<result property="articleType" column="article_type" />
|
||||
<result property="keyword" column="keyword" />
|
||||
<result property="showImg" column="show_img" />
|
||||
<result property="appResourceId" column="app_resource_id" />
|
||||
<result property="lookNumber" column="look_number" />
|
||||
<result property="loveNumber" column="love_number" />
|
||||
<result property="isRecommendation" column="is_recommendation" />
|
||||
<result property="isShow" column="is_show" />
|
||||
<result property="isAd" column="is_ad" />
|
||||
<result property="adNumber" column="ad_number" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="weight" column="weight" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppBlogArticleVo">
|
||||
select id, title, content_info, article_type, keyword, show_img, app_resource_id, look_number, weight, love_number, is_recommendation, is_show, is_ad, ad_number, del_flag, create_by, create_time, remark from app_blog_article
|
||||
</sql>
|
||||
|
||||
<select id="selectAppBlogArticleList" parameterType="AppBlogArticle" resultMap="AppBlogArticleResult">
|
||||
<include refid="selectAppBlogArticleVo"/>
|
||||
<where>
|
||||
<if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
|
||||
<if test="contentInfo != null and contentInfo != ''"> and content_info like concat('%', #{contentInfo}, '%')</if>
|
||||
<if test="articleType != null "> and article_type = #{articleType}</if>
|
||||
<if test="appResourceId != null "> and app_resource_id = #{appResourceId}</if>
|
||||
<if test="isRecommendation != null "> and is_recommendation = #{isRecommendation}</if>
|
||||
<if test="isShow != null "> and is_show = #{isShow}</if>
|
||||
<if test="weight != null "> and weight = #{weight}</if>
|
||||
<if test="keyword != null and keyword != ''"> and (keyword like concat('%', #{keyword}, '%') or title like concat('%', #{keyword}, '%'))</if>
|
||||
</where>
|
||||
<choose>
|
||||
<when test="orderType == 'look_number'"> ORDER BY look_number desc, create_time desc</when >
|
||||
<otherwise> ORDER BY weight desc, create_time desc</otherwise >
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="selectAppBlogArticleById" parameterType="Long" resultMap="AppBlogArticleResult">
|
||||
<include refid="selectAppBlogArticleVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppBlogArticle" parameterType="AppBlogArticle" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_blog_article
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null">title,</if>
|
||||
<if test="contentInfo != null">content_info,</if>
|
||||
<if test="articleType != null">article_type,</if>
|
||||
<if test="keyword != null and keyword != ''">keyword,</if>
|
||||
<if test="showImg != null">show_img,</if>
|
||||
<if test="appResourceId != null">app_resource_id,</if>
|
||||
<if test="lookNumber != null">look_number,</if>
|
||||
<if test="loveNumber != null">love_number,</if>
|
||||
<if test="isRecommendation != null">is_recommendation,</if>
|
||||
<if test="isShow != null">is_show,</if>
|
||||
<if test="isAd != null">is_ad,</if>
|
||||
<if test="adNumber != null">ad_number,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="weight != null">weight,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="contentInfo != null">#{contentInfo},</if>
|
||||
<if test="articleType != null">#{articleType},</if>
|
||||
<if test="keyword != null and keyword != ''">#{keyword},</if>
|
||||
<if test="showImg != null">#{showImg},</if>
|
||||
<if test="appResourceId != null">#{appResourceId},</if>
|
||||
<if test="lookNumber != null">#{lookNumber},</if>
|
||||
<if test="loveNumber != null">#{loveNumber},</if>
|
||||
<if test="isRecommendation != null">#{isRecommendation},</if>
|
||||
<if test="isShow != null">#{isShow},</if>
|
||||
<if test="isAd != null">#{isAd},</if>
|
||||
<if test="adNumber != null">#{adNumber},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="weight != null">#{weight},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppBlogArticle" parameterType="AppBlogArticle">
|
||||
update app_blog_article
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="contentInfo != null">content_info = #{contentInfo},</if>
|
||||
<if test="articleType != null">article_type = #{articleType},</if>
|
||||
<if test="keyword != null and keyword != ''">keyword = #{keyword},</if>
|
||||
<if test="showImg != null">show_img = #{showImg},</if>
|
||||
<if test="appResourceId != null">app_resource_id = #{appResourceId},</if>
|
||||
<if test="lookNumber != null">look_number = #{lookNumber},</if>
|
||||
<if test="loveNumber != null">love_number = #{loveNumber},</if>
|
||||
<if test="isRecommendation != null">is_recommendation = #{isRecommendation},</if>
|
||||
<if test="isShow != null">is_show = #{isShow},</if>
|
||||
<if test="isAd != null">is_ad = #{isAd},</if>
|
||||
<if test="adNumber != null">ad_number = #{adNumber},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppBlogArticleById" parameterType="Long">
|
||||
delete from app_blog_article where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppBlogArticleByIds" parameterType="String">
|
||||
delete from app_blog_article where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
71
ruoyi-system/src/main/resources/mapper/app/AppCamiMapper.xml
Normal file
71
ruoyi-system/src/main/resources/mapper/app/AppCamiMapper.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?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.ruoyi.app.mapper.AppCamiMapper">
|
||||
|
||||
<resultMap type="AppCami" id="AppCamiResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="cami" column="cami" />
|
||||
<result property="camiTyep" column="cami_tyep" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppCamiVo">
|
||||
select id, cami, cami_tyep, create_time, del_flag from app_cami
|
||||
</sql>
|
||||
|
||||
<select id="selectAppCamiList" parameterType="AppCami" resultMap="AppCamiResult">
|
||||
<include refid="selectAppCamiVo"/>
|
||||
<where>
|
||||
<if test="cami != null and cami != ''"> and cami = #{cami}</if>
|
||||
<if test="camiTyep != null "> and cami_tyep = #{camiTyep}</if>
|
||||
<if test="createTime != null "> and create_time = #{createTime}</if>
|
||||
<if test="delFlag != null "> and del_flag = #{delFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppCamiById" parameterType="Long" resultMap="AppCamiResult">
|
||||
<include refid="selectAppCamiVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppCami" parameterType="AppCami" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_cami
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="cami != null">cami,</if>
|
||||
<if test="camiTyep != null">cami_tyep,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="cami != null">#{cami},</if>
|
||||
<if test="camiTyep != null">#{camiTyep},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppCami" parameterType="AppCami">
|
||||
update app_cami
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="cami != null">cami = #{cami},</if>
|
||||
<if test="camiTyep != null">cami_tyep = #{camiTyep},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppCamiById" parameterType="Long">
|
||||
delete from app_cami where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppCamiByIds" parameterType="String">
|
||||
delete from app_cami where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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.ruoyi.app.mapper.AppDuanjuMapper">
|
||||
|
||||
<resultMap type="AppDuanju" id="AppDuanjuResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="bjName" column="bj_name" />
|
||||
<result property="djUrl" column="dj_url" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppDuanjuVo">
|
||||
select id, bj_name, dj_url, create_time from app_duanju
|
||||
</sql>
|
||||
|
||||
<select id="selectAppDuanjuList" parameterType="AppDuanju" resultMap="AppDuanjuResult">
|
||||
<include refid="selectAppDuanjuVo"/>
|
||||
<where>
|
||||
<if test="bjName != null and bjName != ''"> and bj_name like concat('%', #{bjName}, '%')</if>
|
||||
<if test="djUrl != null and djUrl != ''"> and dj_url like concat('%', #{djUrl}, '%')</if>
|
||||
<if test="createTime != null "> and create_time = #{createTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppDuanjuById" parameterType="Long" resultMap="AppDuanjuResult">
|
||||
<include refid="selectAppDuanjuVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppDuanju" parameterType="AppDuanju" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_duanju
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="bjName != null">bj_name,</if>
|
||||
<if test="djUrl != null">dj_url,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="bjName != null">#{bjName},</if>
|
||||
<if test="djUrl != null">#{djUrl},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppDuanju" parameterType="AppDuanju">
|
||||
update app_duanju
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="bjName != null">bj_name = #{bjName},</if>
|
||||
<if test="djUrl != null">dj_url = #{djUrl},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppDuanjuById" parameterType="Long">
|
||||
delete from app_duanju where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppDuanjuByIds" parameterType="String">
|
||||
delete from app_duanju where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,102 @@
|
||||
<?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.ruoyi.app.mapper.AppExchangeGoodsMapper">
|
||||
|
||||
<resultMap type="AppExchangeGoods" id="AppExchangeGoodsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="goodsName" column="goods_name" />
|
||||
<result property="goodsImg" column="goods_img" />
|
||||
<result property="goodsType" column="goods_type" />
|
||||
<result property="goodsExchange" column="goods_exchange" />
|
||||
<result property="isHot" column="is_hot" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="isCami" column="is_cami" />
|
||||
<result property="camiType" column="cami_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppExchangeGoodsVo">
|
||||
select id, goods_name, goods_img, goods_type, goods_exchange, is_hot, del_flag, create_by, create_time, remark, is_cami, cami_type from app_exchange_goods
|
||||
</sql>
|
||||
|
||||
<select id="selectAppExchangeGoodsList" parameterType="AppExchangeGoods" resultMap="AppExchangeGoodsResult">
|
||||
<include refid="selectAppExchangeGoodsVo"/>
|
||||
<where>
|
||||
<if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
|
||||
<if test="goodsImg != null and goodsImg != ''"> and goods_img = #{goodsImg}</if>
|
||||
<if test="goodsType != null "> and goods_type = #{goodsType}</if>
|
||||
<if test="goodsExchange != null "> and goods_exchange = #{goodsExchange}</if>
|
||||
<if test="isHot != null "> and is_hot = #{isHot}</if>
|
||||
<if test="isCami != null "> and is_cami = #{isCami}</if>
|
||||
<if test="camiType != null "> and cami_type = #{camiType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppExchangeGoodsById" parameterType="Long" resultMap="AppExchangeGoodsResult">
|
||||
<include refid="selectAppExchangeGoodsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppExchangeGoods" parameterType="AppExchangeGoods" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_exchange_goods
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="goodsName != null and goodsName != ''">goods_name,</if>
|
||||
<if test="goodsImg != null and goodsImg != ''">goods_img,</if>
|
||||
<if test="goodsType != null">goods_type,</if>
|
||||
<if test="goodsExchange != null">goods_exchange,</if>
|
||||
<if test="isHot != null">is_hot,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="isCami != null">is_cami,</if>
|
||||
<if test="camiType != null">cami_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="goodsName != null and goodsName != ''">#{goodsName},</if>
|
||||
<if test="goodsImg != null and goodsImg != ''">#{goodsImg},</if>
|
||||
<if test="goodsType != null">#{goodsType},</if>
|
||||
<if test="goodsExchange != null">#{goodsExchange},</if>
|
||||
<if test="isHot != null">#{isHot},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="isCami != null">#{isCami},</if>
|
||||
<if test="camiType != null">#{camiType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppExchangeGoods" parameterType="AppExchangeGoods">
|
||||
update app_exchange_goods
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="goodsName != null and goodsName != ''">goods_name = #{goodsName},</if>
|
||||
<if test="goodsImg != null and goodsImg != ''">goods_img = #{goodsImg},</if>
|
||||
<if test="goodsType != null">goods_type = #{goodsType},</if>
|
||||
<if test="goodsExchange != null">goods_exchange = #{goodsExchange},</if>
|
||||
<if test="isHot != null">is_hot = #{isHot},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="isCami != null">is_cami = #{isCami},</if>
|
||||
<if test="camiType != null">cami_type = #{camiType},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppExchangeGoodsById" parameterType="Long">
|
||||
delete from app_exchange_goods where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppExchangeGoodsByIds" parameterType="String">
|
||||
delete from app_exchange_goods where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,81 @@
|
||||
<?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.ruoyi.app.mapper.AppExchangeRecordsMapper">
|
||||
|
||||
<resultMap type="AppExchangeRecords" id="AppExchangeRecordsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="goodsName" column="goods_name" />
|
||||
<result property="recordsUserId" column="records_user_id" />
|
||||
<result property="recordsNumber" column="records_number" />
|
||||
<result property="recordsTime" column="records_time" />
|
||||
<result property="redemptionCode" column="redemption_code" />
|
||||
<result property="redemptionState" column="redemption_state" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppExchangeRecordsVo">
|
||||
select id, goods_name, records_user_id, records_number, records_time, redemption_code, redemption_state from app_exchange_records
|
||||
</sql>
|
||||
|
||||
<select id="selectAppExchangeRecordsList" parameterType="AppExchangeRecords" resultMap="AppExchangeRecordsResult">
|
||||
<include refid="selectAppExchangeRecordsVo"/>
|
||||
<where>
|
||||
<if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
|
||||
<if test="recordsUserId != null "> and records_user_id = #{recordsUserId}</if>
|
||||
<if test="recordsNumber != null "> and records_number = #{recordsNumber}</if>
|
||||
<if test="recordsTime != null "> and records_time = #{recordsTime}</if>
|
||||
<if test="redemptionCode != null and redemptionCode != ''"> and redemption_code = #{redemptionCode}</if>
|
||||
<if test="redemptionState != null and redemptionState != ''"> and redemption_state = #{redemptionState}</if>
|
||||
</where>ORDER BY records_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAppExchangeRecordsById" parameterType="Long" resultMap="AppExchangeRecordsResult">
|
||||
<include refid="selectAppExchangeRecordsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppExchangeRecords" parameterType="AppExchangeRecords" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_exchange_records
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="goodsName != null">goods_name,</if>
|
||||
<if test="recordsUserId != null">records_user_id,</if>
|
||||
<if test="recordsNumber != null">records_number,</if>
|
||||
<if test="recordsTime != null">records_time,</if>
|
||||
<if test="redemptionCode != null">redemption_code,</if>
|
||||
<if test="redemptionState != null">redemption_state,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="goodsName != null">#{goodsName},</if>
|
||||
<if test="recordsUserId != null">#{recordsUserId},</if>
|
||||
<if test="recordsNumber != null">#{recordsNumber},</if>
|
||||
<if test="recordsTime != null">#{recordsTime},</if>
|
||||
<if test="redemptionCode != null">#{redemptionCode},</if>
|
||||
<if test="redemptionState != null">#{redemptionState},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppExchangeRecords" parameterType="AppExchangeRecords">
|
||||
update app_exchange_records
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="goodsName != null">goods_name = #{goodsName},</if>
|
||||
<if test="recordsUserId != null">records_user_id = #{recordsUserId},</if>
|
||||
<if test="recordsNumber != null">records_number = #{recordsNumber},</if>
|
||||
<if test="recordsTime != null">records_time = #{recordsTime},</if>
|
||||
<if test="redemptionCode != null">redemption_code = #{redemptionCode},</if>
|
||||
<if test="redemptionState != null">redemption_state = #{redemptionState},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppExchangeRecordsById" parameterType="Long">
|
||||
delete from app_exchange_records where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppExchangeRecordsByIds" parameterType="String">
|
||||
delete from app_exchange_records where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,99 @@
|
||||
<?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.ruoyi.app.mapper.AppIntegralRecordMapper">
|
||||
|
||||
<resultMap type="AppIntegralRecord" id="AppIntegralRecordResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="source" column="source" />
|
||||
<result property="isAdd" column="is_add" />
|
||||
<result property="integralNumber" column="integral_number" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="resourceId" column="resource_id" />
|
||||
<result property="resourceTitle" column="resource_title" />
|
||||
<result property="integralTime" column="integral_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppIntegralRecordVo">
|
||||
select a.id, a.source, a.is_add, a.integral_number, a.user_id, a.resource_id, a.integral_time, r.resource_title
|
||||
from app_integral_record a
|
||||
left join app_resource r on a.resource_id = r.id
|
||||
</sql>
|
||||
|
||||
<select id="selectAppIntegralRecordList" parameterType="AppIntegralRecord" resultMap="AppIntegralRecordResult">
|
||||
<include refid="selectAppIntegralRecordVo"/>
|
||||
<where>
|
||||
<if test="source != null and source != ''"> and a.source like concat('%', #{source}, '%')</if>
|
||||
<if test="isAdd != null "> and a.is_add = #{isAdd}</if>
|
||||
<if test="integralNumber != null "> and a.integral_number = #{integralNumber}</if>
|
||||
<if test="userId != null "> and a.user_id = #{userId}</if>
|
||||
<if test="resourceId != null "> and a.resource_id = #{resourceId}</if>
|
||||
<if test="resourceTitle != null and resourceTitle != ''"> and r.resource_title like concat('%', #{resourceTitle}, '%')</if>
|
||||
<if test="integralTime != null ">
|
||||
AND date_format(a.integral_time,'%y%m%d') = date_format(#{integralTime},'%y%m%d')
|
||||
</if>
|
||||
</where> ORDER BY a.integral_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAppIntegralRecordCount" parameterType="AppIntegralRecord" resultType="int">
|
||||
SELECT COUNT(0) FROM app_integral_record a
|
||||
<where>
|
||||
<if test="source != null and source != ''"> and a.source like concat('%', #{source}, '%')</if>
|
||||
<if test="isAdd != null "> and a.is_add = #{isAdd}</if>
|
||||
<if test="integralNumber != null "> and a.integral_number = #{integralNumber}</if>
|
||||
<if test="userId != null "> and a.user_id = #{userId}</if>
|
||||
<if test="resourceId != null "> and a.resource_id = #{resourceId}</if>
|
||||
<if test="integralTime != null "> AND date_format(a.integral_time,'%y%m%d') = date_format(#{integralTime},'%y%m%d')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppIntegralRecordById" parameterType="Long" resultMap="AppIntegralRecordResult">
|
||||
<include refid="selectAppIntegralRecordVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppIntegralRecord" parameterType="AppIntegralRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_integral_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="source != null">source,</if>
|
||||
<if test="isAdd != null">is_add,</if>
|
||||
<if test="integralNumber != null">integral_number,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="resourceId != null">resource_id,</if>
|
||||
<if test="integralTime != null">integral_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="source != null">#{source},</if>
|
||||
<if test="isAdd != null">#{isAdd},</if>
|
||||
<if test="integralNumber != null">#{integralNumber},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="resourceId != null">#{resourceId},</if>
|
||||
<if test="integralTime != null">#{integralTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppIntegralRecord" parameterType="AppIntegralRecord">
|
||||
update app_integral_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="source != null">source = #{source},</if>
|
||||
<if test="isAdd != null">is_add = #{isAdd},</if>
|
||||
<if test="integralNumber != null">integral_number = #{integralNumber},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="resourceId != null">resource_id = #{resourceId},</if>
|
||||
<if test="integralTime != null">integral_time = #{integralTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppIntegralRecordById" parameterType="Long">
|
||||
delete from app_integral_record where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppIntegralRecordByIds" parameterType="String">
|
||||
delete from app_integral_record where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?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.ruoyi.app.mapper.AppLotteryGoodsMapper">
|
||||
|
||||
<resultMap type="AppLotteryGoods" id="AppLotteryGoodsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="image" column="image" />
|
||||
<result property="name" column="name" />
|
||||
<result property="percentage" column="percentage" />
|
||||
<result property="reward" column="reward" />
|
||||
<result property="indexNum" column="index_num" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppLotteryGoodsVo">
|
||||
select id, image, name, percentage, reward, index_num from app_lottery_goods
|
||||
</sql>
|
||||
|
||||
<select id="selectAppLotteryGoodsList" parameterType="AppLotteryGoods" resultMap="AppLotteryGoodsResult">
|
||||
<include refid="selectAppLotteryGoodsVo"/>
|
||||
<where>
|
||||
<if test="image != null and image != ''"> and image = #{image}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="percentage != null "> and percentage = #{percentage}</if>
|
||||
<if test="reward != null "> and reward = #{reward}</if>
|
||||
<if test="indexNum != null "> and index_num = #{indexNum}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppLotteryGoodsById" parameterType="Long" resultMap="AppLotteryGoodsResult">
|
||||
<include refid="selectAppLotteryGoodsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppLotteryGoods" parameterType="AppLotteryGoods">
|
||||
insert into app_lottery_goods
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="image != null">image,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="percentage != null">percentage,</if>
|
||||
<if test="reward != null">reward,</if>
|
||||
<if test="indexNum != null">index_num,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="image != null">#{image},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="percentage != null">#{percentage},</if>
|
||||
<if test="reward != null">#{reward},</if>
|
||||
<if test="indexNum != null">#{indexNum},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppLotteryGoods" parameterType="AppLotteryGoods">
|
||||
update app_lottery_goods
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="image != null">image = #{image},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="percentage != null">percentage = #{percentage},</if>
|
||||
<if test="reward != null">reward = #{reward},</if>
|
||||
<if test="indexNum != null">index_num = #{indexNum},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppLotteryGoodsById" parameterType="Long">
|
||||
delete from app_lottery_goods where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppLotteryGoodsByIds" parameterType="String">
|
||||
delete from app_lottery_goods where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?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.ruoyi.app.mapper.AppLotteryLogMapper">
|
||||
|
||||
<resultMap type="AppLotteryLog" id="AppLotteryLogResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="goodId" column="good_id" />
|
||||
<result property="lotteryUserId" column="lottery_user_id" />
|
||||
<result property="lotteryTime" column="lottery_time" />
|
||||
<result property="name" column="name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppLotteryLogVo">
|
||||
select a.id, good_id, lottery_user_id, lottery_time,b.`name` from app_lottery_log a left join app_lottery_goods b on a.good_id = b.id
|
||||
</sql>
|
||||
|
||||
<select id="selectAppLotteryLogList" parameterType="AppLotteryLog" resultMap="AppLotteryLogResult">
|
||||
<include refid="selectAppLotteryLogVo"/>
|
||||
<where>
|
||||
<if test="goodId != null "> and good_id = #{goodId}</if>
|
||||
<if test="lotteryUserId != null "> and lottery_user_id = #{lotteryUserId}</if>
|
||||
<if test="lotteryTime != null "> and lottery_time = #{lotteryTime}</if>
|
||||
</where> ORDER BY lottery_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAppLotteryLogById" parameterType="Long" resultMap="AppLotteryLogResult">
|
||||
<include refid="selectAppLotteryLogVo"/>
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppLotteryLog" parameterType="AppLotteryLog" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_lottery_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="goodId != null">good_id,</if>
|
||||
<if test="lotteryUserId != null">lottery_user_id,</if>
|
||||
<if test="lotteryTime != null">lottery_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="goodId != null">#{goodId},</if>
|
||||
<if test="lotteryUserId != null">#{lotteryUserId},</if>
|
||||
<if test="lotteryTime != null">#{lotteryTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppLotteryLog" parameterType="AppLotteryLog">
|
||||
update app_lottery_log
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="goodId != null">good_id = #{goodId},</if>
|
||||
<if test="lotteryUserId != null">lottery_user_id = #{lotteryUserId},</if>
|
||||
<if test="lotteryTime != null">lottery_time = #{lotteryTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppLotteryLogById" parameterType="Long">
|
||||
delete from app_lottery_log where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppLotteryLogByIds" parameterType="String">
|
||||
delete from app_lottery_log where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?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.ruoyi.app.mapper.AppPayOrderMapper">
|
||||
|
||||
<resultMap type="AppPayOrder" id="AppPayOrderResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderNo" column="order_no" />
|
||||
<result property="tradeNo" column="trade_no" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="openId" column="open_id" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="points" column="points" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="payTime" column="pay_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppPayOrderVo">
|
||||
select id, order_no, trade_no, user_id, open_id, amount, points, status, create_time, pay_time from app_pay_order
|
||||
</sql>
|
||||
|
||||
<select id="selectAppPayOrderList" parameterType="AppPayOrder" resultMap="AppPayOrderResult">
|
||||
<include refid="selectAppPayOrderVo"/>
|
||||
<where>
|
||||
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
|
||||
<if test="tradeNo != null and tradeNo != ''"> and trade_no = #{tradeNo}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="openId != null and openId != ''"> and open_id = #{openId}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="payTime != null "> and pay_time = #{payTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAppPayOrderById" parameterType="Long" resultMap="AppPayOrderResult">
|
||||
<include refid="selectAppPayOrderVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectAppPayOrderByOrderNo" parameterType="String" resultMap="AppPayOrderResult">
|
||||
<include refid="selectAppPayOrderVo"/>
|
||||
where order_no = #{orderNo}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppPayOrder" parameterType="AppPayOrder" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_pay_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="orderNo != null and orderNo != ''">order_no,</if>
|
||||
<if test="tradeNo != null and tradeNo != ''">trade_no,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="openId != null and openId != ''">open_id,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="points != null">points,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="payTime != null">pay_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="orderNo != null and orderNo != ''">#{orderNo},</if>
|
||||
<if test="tradeNo != null and tradeNo != ''">#{tradeNo},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="openId != null and openId != ''">#{openId},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="points != null">#{points},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="payTime != null">#{payTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppPayOrder" parameterType="AppPayOrder">
|
||||
update app_pay_order
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderNo != null and orderNo != ''">order_no = #{orderNo},</if>
|
||||
<if test="tradeNo != null and tradeNo != ''">trade_no = #{tradeNo},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="openId != null and openId != ''">open_id = #{openId},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="points != null">points = #{points},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="payTime != null">pay_time = #{payTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppPayOrderById" parameterType="Long">
|
||||
delete from app_pay_order where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppPayOrderByIds" parameterType="String">
|
||||
delete from app_pay_order where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
164
ruoyi-system/src/main/resources/mapper/app/AppResourceMapper.xml
Normal file
164
ruoyi-system/src/main/resources/mapper/app/AppResourceMapper.xml
Normal file
@@ -0,0 +1,164 @@
|
||||
<?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.ruoyi.app.mapper.AppResourceMapper">
|
||||
|
||||
<resultMap type="AppResource" id="AppResourceResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="resourceTitle" column="resource_title" />
|
||||
<result property="showImg" column="show_img" />
|
||||
<result property="explain" column="explain" />
|
||||
<result property="resourceType" column="resource_type" />
|
||||
<result property="keyword" column="keyword" />
|
||||
<result property="isShow" column="is_show" />
|
||||
<result property="isAd" column="is_ad" />
|
||||
<result property="adNumber" column="ad_number" />
|
||||
<result property="downNum" column="down_num" />
|
||||
<result property="weight" column="weight" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="AppResourceAppResourceListResult" type="AppResource" extends="AppResourceResult">
|
||||
<collection property="appResourceListList" notNullColumn="sub_id" javaType="java.util.List" resultMap="AppResourceListResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="AppResourceList" id="AppResourceListResult">
|
||||
<result property="id" column="sub_id" />
|
||||
<result property="listName" column="sub_list_name" />
|
||||
<result property="listUrl" column="sub_list_url" />
|
||||
<result property="password" column="sub_password" />
|
||||
<result property="appResourceId" column="sub_app_resource_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppResourceVo">
|
||||
select id, resource_title, show_img, `explain`, resource_type, keyword, is_show, is_ad, ad_number, down_num, weight, del_flag, create_by, create_time, remark from app_resource
|
||||
</sql>
|
||||
|
||||
<select id="selectAppResourceList" parameterType="AppResource" resultMap="AppResourceResult">
|
||||
<include refid="selectAppResourceVo"/>
|
||||
<where>
|
||||
<if test="resourceTitle != null and resourceTitle != ''"> and resource_title like concat('%', #{resourceTitle}, '%')</if>
|
||||
<if test="showImg != null and showImg != ''"> and show_img = #{showImg}</if>
|
||||
<if test="explain != null and explain != ''"> and `explain` = #{explain}</if>
|
||||
<if test="resourceType != null "> and resource_type = #{resourceType}</if>
|
||||
<if test="isShow != null "> and is_show = #{isShow}</if>
|
||||
<if test="isAd != null "> and is_ad = #{isAd}</if>
|
||||
<if test="adNumber != null "> and ad_number = #{adNumber}</if>
|
||||
<if test="downNum != null "> and down_num = #{downNum}</if>
|
||||
<if test="weight != null "> and weight = #{weight}</if>
|
||||
<if test="keyword != null and keyword != ''"> and (keyword like concat('%', #{keyword}, '%') or resource_title like concat('%', #{keyword}, '%'))</if>
|
||||
</where> ORDER BY weight desc, create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAppResourceById" parameterType="Long" resultMap="AppResourceAppResourceListResult">
|
||||
select a.id, a.resource_title, a.show_img, a.`explain`,a.`keyword`, a.resource_type, a.is_show, a.is_ad, a.ad_number, a.down_num, a.weight, a.del_flag, a.create_by, a.create_time, a.remark,
|
||||
b.id as sub_id, b.list_name as sub_list_name, b.list_url as sub_list_url, b.password as sub_password, b.app_resource_id as sub_app_resource_id
|
||||
from app_resource a
|
||||
left join app_resource_list b on b.app_resource_id = a.id
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppResource" parameterType="AppResource" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_resource
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="resourceTitle != null and resourceTitle != ''">resource_title,</if>
|
||||
<if test="showImg != null and showImg != ''">show_img,</if>
|
||||
<if test="explain != null">`explain`,</if>
|
||||
<if test="resourceType != null">resource_type,</if>
|
||||
<if test="keyword != null and keyword != ''">keyword,</if>
|
||||
<if test="isShow != null">is_show,</if>
|
||||
<if test="isAd != null">is_ad,</if>
|
||||
<if test="adNumber != null">ad_number,</if>
|
||||
<if test="downNum != null">down_num,</if>
|
||||
<if test="weight != null">weight,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="resourceTitle != null and resourceTitle != ''">#{resourceTitle},</if>
|
||||
<if test="showImg != null and showImg != ''">#{showImg},</if>
|
||||
<if test="explain != null">#{explain},</if>
|
||||
<if test="resourceType != null">#{resourceType},</if>
|
||||
<if test="keyword != null and keyword != ''">#{keyword},</if>
|
||||
<if test="isShow != null">#{isShow},</if>
|
||||
<if test="isAd != null">#{isAd},</if>
|
||||
<if test="adNumber != null">#{adNumber},</if>
|
||||
<if test="downNum != null">#{downNum},</if>
|
||||
<if test="weight != null">#{weight},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppResource" parameterType="AppResource">
|
||||
update app_resource
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="resourceTitle != null and resourceTitle != ''">resource_title = #{resourceTitle},</if>
|
||||
<if test="showImg != null and showImg != ''">show_img = #{showImg},</if>
|
||||
<if test="explain != null">`explain` = #{explain},</if>
|
||||
<if test="resourceType != null">resource_type = #{resourceType},</if>
|
||||
<if test="keyword != null and keyword != ''">keyword = #{keyword},</if>
|
||||
<if test="isShow != null">is_show = #{isShow},</if>
|
||||
<if test="isAd != null">is_ad = #{isAd},</if>
|
||||
<if test="adNumber != null">ad_number = #{adNumber},</if>
|
||||
<if test="downNum != null">down_num = #{downNum},</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppResourceById" parameterType="Long">
|
||||
delete from app_resource where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppResourceByIds" parameterType="String">
|
||||
delete from app_resource where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppResourceListByAppResourceIds" parameterType="String">
|
||||
delete from app_resource_list where app_resource_id in
|
||||
<foreach item="appResourceId" collection="array" open="(" separator="," close=")">
|
||||
#{appResourceId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppResourceListByAppResourceId" parameterType="Long">
|
||||
delete from app_resource_list where app_resource_id = #{appResourceId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchAppResourceList">
|
||||
insert into app_resource_list( id, list_name, list_url, password, app_resource_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.listName}, #{item.listUrl}, #{item.password}, #{item.appResourceId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="selectAppResourceByIdAndUserId" resultMap="AppResourceAppResourceListResult">
|
||||
select a.id, a.resource_title, a.show_img, a.`explain`, a.`keyword`, a.resource_type, a.is_show,
|
||||
CASE
|
||||
WHEN (SELECT COUNT(1) FROM app_integral_record WHERE resource_id = #{id} AND user_id = #{userId}) > 0 THEN 0
|
||||
ELSE a.is_ad
|
||||
END as is_ad,
|
||||
a.ad_number, a.down_num, a.weight, a.del_flag, a.create_by, a.create_time, a.remark,
|
||||
b.id as sub_id, b.list_name as sub_list_name, b.list_url as sub_list_url,
|
||||
b.password as sub_password, b.app_resource_id as sub_app_resource_id
|
||||
from app_resource a
|
||||
left join app_resource_list b on b.app_resource_id = a.id
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,78 @@
|
||||
<?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.ruoyi.app.mapper.AppResourceNewMapper">
|
||||
|
||||
<resultMap type="AppResourceNew" id="AppResourceNewResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="resourceName" column="resource_name" />
|
||||
<result property="resourceUrl" column="resource_url" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="copyNumber" column="copy_number" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppResourceNewVo">
|
||||
select id, resource_name, resource_url, create_time, copy_number from app_resource_new
|
||||
</sql>
|
||||
|
||||
<select id="selectAppResourceNewList" parameterType="AppResourceNew" resultMap="AppResourceNewResult">
|
||||
<include refid="selectAppResourceNewVo"/>
|
||||
<where>
|
||||
<if test="resourceName != null and resourceName != ''"> and resource_name like concat('%', #{resourceName}, '%')</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectAppResourceNewById" parameterType="Long" resultMap="AppResourceNewResult">
|
||||
<include refid="selectAppResourceNewVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppResourceNew" parameterType="AppResourceNew" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_resource_new
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="resourceName != null">resource_name,</if>
|
||||
<if test="resourceUrl != null">resource_url,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="copyNumber != null">copy_number,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="resourceName != null">#{resourceName},</if>
|
||||
<if test="resourceUrl != null">#{resourceUrl},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="copyNumber != null">#{copyNumber},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppResourceNew" parameterType="AppResourceNew">
|
||||
update app_resource_new
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="resourceName != null">resource_name = #{resourceName},</if>
|
||||
<if test="resourceUrl != null">resource_url = #{resourceUrl},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="copyNumber != null">copy_number = #{copyNumber},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppResourceNewById" parameterType="Long">
|
||||
delete from app_resource_new where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppResourceNewByIds" parameterType="String">
|
||||
delete from app_resource_new where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateCopyNumber" parameterType="Long">
|
||||
update app_resource_new set copy_number = copy_number + 1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectRankingList" resultMap="AppResourceNewResult">
|
||||
<include refid="selectAppResourceNewVo"/>
|
||||
order by copy_number desc limit 10
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,94 @@
|
||||
<?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.ruoyi.app.mapper.AppWallpaperMapper">
|
||||
|
||||
<resultMap type="AppWallpaper" id="AppWallpaperResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="imgUrl" column="img_url" />
|
||||
<result property="isAd" column="is_ad" />
|
||||
<result property="isShow" column="is_show" />
|
||||
<result property="downNum" column="down_num" />
|
||||
<result property="keyword" column="keyword" />
|
||||
<result property="wallpaperType" column="wallpaper_type" />
|
||||
<result property="weight" column="weight" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="compressImgUrl" column="compress_img_url" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAppWallpaperVo">
|
||||
select id, img_url, is_ad, is_show, down_num, keyword, wallpaper_type, weight, create_time, compress_img_url from app_wallpaper
|
||||
</sql>
|
||||
|
||||
<select id="selectAppWallpaperList" parameterType="AppWallpaper" resultMap="AppWallpaperResult">
|
||||
<include refid="selectAppWallpaperVo"/>
|
||||
<where>
|
||||
<if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
|
||||
<if test="isAd != null "> and is_ad = #{isAd}</if>
|
||||
<if test="isShow != null and isShow != ''"> and is_show = #{isShow}</if>
|
||||
<if test="downNum != null and downNum != ''"> and down_num = #{downNum}</if>
|
||||
<if test="keyword != null and keyword != ''"> and keyword like concat('%', #{keyword}, '%')</if>
|
||||
<if test="wallpaperType != null "> and wallpaper_type = #{wallpaperType}</if>
|
||||
<if test="weight != null "> and weight = #{weight}</if>
|
||||
</where> ORDER BY weight desc, create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAppWallpaperById" parameterType="Long" resultMap="AppWallpaperResult">
|
||||
<include refid="selectAppWallpaperVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAppWallpaper" parameterType="AppWallpaper" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into app_wallpaper
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="imgUrl != null and imgUrl != ''">img_url,</if>
|
||||
<if test="isAd != null">is_ad,</if>
|
||||
<if test="isShow != null and isShow != ''">is_show,</if>
|
||||
<if test="downNum != null">down_num,</if>
|
||||
<if test="keyword != null and keyword != ''">keyword,</if>
|
||||
<if test="wallpaperType != null">wallpaper_type,</if>
|
||||
<if test="weight != null">weight,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="compressImgUrl != null">compress_img_url,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="imgUrl != null and imgUrl != ''">#{imgUrl},</if>
|
||||
<if test="isAd != null">#{isAd},</if>
|
||||
<if test="isShow != null and isShow != ''">#{isShow},</if>
|
||||
<if test="downNum != null">#{downNum},</if>
|
||||
<if test="keyword != null and keyword != ''">#{keyword},</if>
|
||||
<if test="wallpaperType != null">#{wallpaperType},</if>
|
||||
<if test="weight != null">#{weight},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="compressImgUrl != null">#{compressImgUrl},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAppWallpaper" parameterType="AppWallpaper">
|
||||
update app_wallpaper
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="imgUrl != null and imgUrl != ''">img_url = #{imgUrl},</if>
|
||||
<if test="isAd != null">is_ad = #{isAd},</if>
|
||||
<if test="isShow != null and isShow != ''">is_show = #{isShow},</if>
|
||||
<if test="downNum != null">down_num = #{downNum},</if>
|
||||
<if test="keyword != null and keyword != ''">keyword = #{keyword},</if>
|
||||
<if test="wallpaperType != null">wallpaper_type = #{wallpaperType},</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="compressImgUrl != null">compress_img_url = #{compressImgUrl},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAppWallpaperById" parameterType="Long">
|
||||
delete from app_wallpaper where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAppWallpaperByIds" parameterType="String">
|
||||
delete from app_wallpaper where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,55 @@
|
||||
<?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.ruoyi.app.mapper.NewDownloadUrlMapper">
|
||||
|
||||
<resultMap type="NewDownloadUrl" id="NewDownloadUrlResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="httpUrl" column="http_url" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNewDownloadUrlVo">
|
||||
select id, http_url from new_download_url
|
||||
</sql>
|
||||
|
||||
<select id="selectNewDownloadUrlList" parameterType="NewDownloadUrl" resultMap="NewDownloadUrlResult">
|
||||
<include refid="selectNewDownloadUrlVo"/>
|
||||
<where>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectNewDownloadUrlById" parameterType="Long" resultMap="NewDownloadUrlResult">
|
||||
<include refid="selectNewDownloadUrlVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertNewDownloadUrl" parameterType="NewDownloadUrl" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into new_download_url
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="httpUrl != null">http_url,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="httpUrl != null">#{httpUrl},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateNewDownloadUrl" parameterType="NewDownloadUrl">
|
||||
update new_download_url
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="httpUrl != null">http_url = #{httpUrl},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteNewDownloadUrlById" parameterType="Long">
|
||||
delete from new_download_url where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNewDownloadUrlByIds" parameterType="String">
|
||||
delete from new_download_url where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?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.ruoyi.system.mapper.SysConfigMapper">
|
||||
|
||||
<resultMap type="SysConfig" id="SysConfigResult">
|
||||
<id property="configId" column="config_id" />
|
||||
<result property="configName" column="config_name" />
|
||||
<result property="configKey" column="config_key" />
|
||||
<result property="configValue" column="config_value" />
|
||||
<result property="configType" column="config_type" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectConfigVo">
|
||||
select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark
|
||||
from sys_config
|
||||
</sql>
|
||||
|
||||
<!-- 查询条件 -->
|
||||
<sql id="sqlwhereSearch">
|
||||
<where>
|
||||
<if test="configId !=null">
|
||||
and config_id = #{configId}
|
||||
</if>
|
||||
<if test="configKey !=null and configKey != ''">
|
||||
and config_key = #{configKey}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<include refid="sqlwhereSearch"/>
|
||||
</select>
|
||||
|
||||
<select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
<where>
|
||||
<if test="configName != null and configName != ''">
|
||||
AND config_name like concat('%', #{configName}, '%')
|
||||
</if>
|
||||
<if test="configType != null and configType != ''">
|
||||
AND config_type = #{configType}
|
||||
</if>
|
||||
<if test="configKey != null and configKey != ''">
|
||||
AND config_key like concat('%', #{configKey}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectConfigById" parameterType="Long" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
where config_id = #{configId}
|
||||
</select>
|
||||
|
||||
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
|
||||
<include refid="selectConfigVo"/>
|
||||
where config_key = #{configKey} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertConfig" parameterType="SysConfig">
|
||||
insert into sys_config (
|
||||
<if test="configName != null and configName != '' ">config_name,</if>
|
||||
<if test="configKey != null and configKey != '' ">config_key,</if>
|
||||
<if test="configValue != null and configValue != '' ">config_value,</if>
|
||||
<if test="configType != null and configType != '' ">config_type,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="configName != null and configName != ''">#{configName},</if>
|
||||
<if test="configKey != null and configKey != ''">#{configKey},</if>
|
||||
<if test="configValue != null and configValue != ''">#{configValue},</if>
|
||||
<if test="configType != null and configType != ''">#{configType},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateConfig" parameterType="SysConfig">
|
||||
update sys_config
|
||||
<set>
|
||||
<if test="configName != null and configName != ''">config_name = #{configName},</if>
|
||||
<if test="configKey != null and configKey != ''">config_key = #{configKey},</if>
|
||||
<if test="configValue != null and configValue != ''">config_value = #{configValue},</if>
|
||||
<if test="configType != null and configType != ''">config_type = #{configType},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where config_id = #{configId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteConfigById" parameterType="Long">
|
||||
delete from sys_config where config_id = #{configId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteConfigByIds" parameterType="Long">
|
||||
delete from sys_config where config_id in
|
||||
<foreach item="configId" collection="array" open="(" separator="," close=")">
|
||||
#{configId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
159
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
Normal file
159
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
Normal file
@@ -0,0 +1,159 @@
|
||||
<?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.ruoyi.system.mapper.SysDeptMapper">
|
||||
|
||||
<resultMap type="SysDept" id="SysDeptResult">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="leader" column="leader" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="email" column="email" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="parentName" column="parent_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeptVo">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
|
||||
from sys_dept d
|
||||
</sql>
|
||||
|
||||
<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where d.del_flag = '0'
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND dept_id = #{deptId}
|
||||
</if>
|
||||
<if test="parentId != null and parentId != 0">
|
||||
AND parent_id = #{parentId}
|
||||
</if>
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND dept_name like concat('%', #{deptName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptListByRoleId" resultType="Long">
|
||||
select d.dept_id
|
||||
from sys_dept d
|
||||
left join sys_role_dept rd on d.dept_id = rd.dept_id
|
||||
where rd.role_id = #{roleId}
|
||||
<if test="deptCheckStrictly">
|
||||
and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
|
||||
</if>
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
|
||||
(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
|
||||
from sys_dept d
|
||||
where d.dept_id = #{deptId}
|
||||
</select>
|
||||
|
||||
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
||||
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="hasChildByDeptId" parameterType="Long" resultType="int">
|
||||
select count(1) from sys_dept
|
||||
where del_flag = '0' and parent_id = #{deptId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
|
||||
select * from sys_dept where find_in_set(#{deptId}, ancestors)
|
||||
</select>
|
||||
|
||||
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
|
||||
select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors)
|
||||
</select>
|
||||
|
||||
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
||||
<include refid="selectDeptVo"/>
|
||||
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDept" parameterType="SysDept">
|
||||
insert into sys_dept(
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="leader != null and leader != ''">leader,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="leader != null and leader != ''">#{leader},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDept" parameterType="SysDept">
|
||||
update sys_dept
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="leader != null">leader = #{leader},</if>
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="email != null">email = #{email},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dept_id = #{deptId}
|
||||
</update>
|
||||
|
||||
<update id="updateDeptChildren" parameterType="java.util.List">
|
||||
update sys_dept set ancestors =
|
||||
<foreach collection="depts" item="item" index="index"
|
||||
separator=" " open="case dept_id" close="end">
|
||||
when #{item.deptId} then #{item.ancestors}
|
||||
</foreach>
|
||||
where dept_id in
|
||||
<foreach collection="depts" item="item" index="index"
|
||||
separator="," open="(" close=")">
|
||||
#{item.deptId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateDeptStatusNormal" parameterType="Long">
|
||||
update sys_dept set status = '0' where dept_id in
|
||||
<foreach collection="array" item="deptId" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<delete id="deleteDeptById" parameterType="Long">
|
||||
update sys_dept set del_flag = '2' where dept_id = #{deptId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,124 @@
|
||||
<?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.ruoyi.system.mapper.SysDictDataMapper">
|
||||
|
||||
<resultMap type="SysDictData" id="SysDictDataResult">
|
||||
<id property="dictCode" column="dict_code" />
|
||||
<result property="dictSort" column="dict_sort" />
|
||||
<result property="dictLabel" column="dict_label" />
|
||||
<result property="dictValue" column="dict_value" />
|
||||
<result property="dictType" column="dict_type" />
|
||||
<result property="cssClass" column="css_class" />
|
||||
<result property="listClass" column="list_class" />
|
||||
<result property="isDefault" column="is_default" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDictDataVo">
|
||||
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark
|
||||
from sys_dict_data
|
||||
</sql>
|
||||
|
||||
<select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
<where>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
AND dict_type = #{dictType}
|
||||
</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">
|
||||
AND dict_label like concat('%', #{dictLabel}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by dict_sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where status = '0' and dict_type = #{dictType} order by dict_sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectDictLabel" resultType="String">
|
||||
select dict_label from sys_dict_data
|
||||
where dict_type = #{dictType} and dict_value = #{dictValue}
|
||||
</select>
|
||||
|
||||
<select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult">
|
||||
<include refid="selectDictDataVo"/>
|
||||
where dict_code = #{dictCode}
|
||||
</select>
|
||||
|
||||
<select id="countDictDataByType" resultType="Integer">
|
||||
select count(1) from sys_dict_data where dict_type=#{dictType}
|
||||
</select>
|
||||
|
||||
<delete id="deleteDictDataById" parameterType="Long">
|
||||
delete from sys_dict_data where dict_code = #{dictCode}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDictDataByIds" parameterType="Long">
|
||||
delete from sys_dict_data where dict_code in
|
||||
<foreach collection="array" item="dictCode" open="(" separator="," close=")">
|
||||
#{dictCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictData" parameterType="SysDictData">
|
||||
update sys_dict_data
|
||||
<set>
|
||||
<if test="dictSort != null">dict_sort = #{dictSort},</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if>
|
||||
<if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
|
||||
<if test="cssClass != null">css_class = #{cssClass},</if>
|
||||
<if test="listClass != null">list_class = #{listClass},</if>
|
||||
<if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dict_code = #{dictCode}
|
||||
</update>
|
||||
|
||||
<update id="updateDictDataType" parameterType="String">
|
||||
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictData" parameterType="SysDictData">
|
||||
insert into sys_dict_data(
|
||||
<if test="dictSort != null">dict_sort,</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
||||
<if test="dictValue != null and dictValue != ''">dict_value,</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||
<if test="cssClass != null and cssClass != ''">css_class,</if>
|
||||
<if test="listClass != null and listClass != ''">list_class,</if>
|
||||
<if test="isDefault != null and isDefault != ''">is_default,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="dictSort != null">#{dictSort},</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
|
||||
<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
|
||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
||||
<if test="cssClass != null and cssClass != ''">#{cssClass},</if>
|
||||
<if test="listClass != null and listClass != ''">#{listClass},</if>
|
||||
<if test="isDefault != null and isDefault != ''">#{isDefault},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,105 @@
|
||||
<?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.ruoyi.system.mapper.SysDictTypeMapper">
|
||||
|
||||
<resultMap type="SysDictType" id="SysDictTypeResult">
|
||||
<id property="dictId" column="dict_id" />
|
||||
<result property="dictName" column="dict_name" />
|
||||
<result property="dictType" column="dict_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDictTypeVo">
|
||||
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
|
||||
from sys_dict_type
|
||||
</sql>
|
||||
|
||||
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
<where>
|
||||
<if test="dictName != null and dictName != ''">
|
||||
AND dict_name like concat('%', #{dictName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
AND dict_type like concat('%', #{dictType}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_id = #{dictId}
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType}
|
||||
</select>
|
||||
|
||||
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType} limit 1
|
||||
</select>
|
||||
|
||||
<delete id="deleteDictTypeById" parameterType="Long">
|
||||
delete from sys_dict_type where dict_id = #{dictId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDictTypeByIds" parameterType="Long">
|
||||
delete from sys_dict_type where dict_id in
|
||||
<foreach collection="array" item="dictId" open="(" separator="," close=")">
|
||||
#{dictId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictType" parameterType="SysDictType">
|
||||
update sys_dict_type
|
||||
<set>
|
||||
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dict_id = #{dictId}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictType" parameterType="SysDictType">
|
||||
insert into sys_dict_type(
|
||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="dictName != null and dictName != ''">#{dictName},</if>
|
||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?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.ruoyi.system.mapper.SysLogininforMapper">
|
||||
|
||||
<resultMap type="SysLogininfor" id="SysLogininforResult">
|
||||
<id property="infoId" column="info_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="ipaddr" column="ipaddr" />
|
||||
<result property="loginLocation" column="login_location" />
|
||||
<result property="browser" column="browser" />
|
||||
<result property="os" column="os" />
|
||||
<result property="msg" column="msg" />
|
||||
<result property="loginTime" column="login_time" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertLogininfor" parameterType="SysLogininfor">
|
||||
insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
|
||||
values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
|
||||
</insert>
|
||||
|
||||
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
|
||||
select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
|
||||
<where>
|
||||
<if test="ipaddr != null and ipaddr != ''">
|
||||
AND ipaddr like concat('%', #{ipaddr}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND login_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND login_time <= #{params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by info_id desc
|
||||
</select>
|
||||
|
||||
<delete id="deleteLogininforByIds" parameterType="Long">
|
||||
delete from sys_logininfor where info_id in
|
||||
<foreach collection="array" item="infoId" open="(" separator="," close=")">
|
||||
#{infoId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="cleanLogininfor">
|
||||
truncate table sys_logininfor
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
202
ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
Normal file
202
ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
Normal file
@@ -0,0 +1,202 @@
|
||||
<?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.ruoyi.system.mapper.SysMenuMapper">
|
||||
|
||||
<resultMap type="SysMenu" id="SysMenuResult">
|
||||
<id property="menuId" column="menu_id" />
|
||||
<result property="menuName" column="menu_name" />
|
||||
<result property="parentName" column="parent_name" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="path" column="path" />
|
||||
<result property="component" column="component" />
|
||||
<result property="query" column="query" />
|
||||
<result property="isFrame" column="is_frame" />
|
||||
<result property="isCache" column="is_cache" />
|
||||
<result property="menuType" column="menu_type" />
|
||||
<result property="visible" column="visible" />
|
||||
<result property="status" column="status" />
|
||||
<result property="perms" column="perms" />
|
||||
<result property="icon" column="icon" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMenuVo">
|
||||
select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time
|
||||
from sys_menu
|
||||
</sql>
|
||||
|
||||
<select id="selectMenuList" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
<where>
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND menu_name like concat('%', #{menuName}, '%')
|
||||
</if>
|
||||
<if test="visible != null and visible != ''">
|
||||
AND visible = #{visible}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
order by parent_id, order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuTreeAll" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
left join sys_role ro on ur.role_id = ro.role_id
|
||||
where ur.user_id = #{params.userId}
|
||||
<if test="menuName != null and menuName != ''">
|
||||
AND m.menu_name like concat('%', #{menuName}, '%')
|
||||
</if>
|
||||
<if test="visible != null and visible != ''">
|
||||
AND m.visible = #{visible}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND m.status = #{status}
|
||||
</if>
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
|
||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
left join sys_role ro on ur.role_id = ro.role_id
|
||||
left join sys_user u on ur.user_id = u.user_id
|
||||
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuListByRoleId" resultType="Long">
|
||||
select m.menu_id
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
where rm.role_id = #{roleId}
|
||||
<if test="menuCheckStrictly">
|
||||
and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
|
||||
</if>
|
||||
order by m.parent_id, m.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMenuPerms" resultType="String">
|
||||
select distinct m.perms
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
</select>
|
||||
|
||||
<select id="selectMenuPermsByUserId" parameterType="Long" resultType="String">
|
||||
select distinct m.perms
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
where m.status = '0' and r.status = '0' and ur.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectMenuPermsByRoleId" parameterType="Long" resultType="String">
|
||||
select distinct m.perms
|
||||
from sys_menu m
|
||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||
where m.status = '0' and rm.role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="selectMenuById" parameterType="Long" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="hasChildByMenuId" resultType="Integer">
|
||||
select count(1) from sys_menu where parent_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
|
||||
<include refid="selectMenuVo"/>
|
||||
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updateMenu" parameterType="SysMenu">
|
||||
update sys_menu
|
||||
<set>
|
||||
<if test="menuName != null and menuName != ''">menu_name = #{menuName},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="path != null and path != ''">path = #{path},</if>
|
||||
<if test="component != null">component = #{component},</if>
|
||||
<if test="query != null">`query` = #{query},</if>
|
||||
<if test="isFrame != null and isFrame != ''">is_frame = #{isFrame},</if>
|
||||
<if test="isCache != null and isCache != ''">is_cache = #{isCache},</if>
|
||||
<if test="menuType != null and menuType != ''">menu_type = #{menuType},</if>
|
||||
<if test="visible != null">visible = #{visible},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="perms !=null">perms = #{perms},</if>
|
||||
<if test="icon !=null and icon != ''">icon = #{icon},</if>
|
||||
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where menu_id = #{menuId}
|
||||
</update>
|
||||
|
||||
<insert id="insertMenu" parameterType="SysMenu">
|
||||
insert into sys_menu(
|
||||
<if test="menuId != null and menuId != 0">menu_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="menuName != null and menuName != ''">menu_name,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="path != null and path != ''">path,</if>
|
||||
<if test="component != null and component != ''">component,</if>
|
||||
<if test="query != null and query != ''">`query`,</if>
|
||||
<if test="isFrame != null and isFrame != ''">is_frame,</if>
|
||||
<if test="isCache != null and isCache != ''">is_cache,</if>
|
||||
<if test="menuType != null and menuType != ''">menu_type,</if>
|
||||
<if test="visible != null">visible,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="perms !=null and perms != ''">perms,</if>
|
||||
<if test="icon != null and icon != ''">icon,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="menuId != null and menuId != 0">#{menuId},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="menuName != null and menuName != ''">#{menuName},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="path != null and path != ''">#{path},</if>
|
||||
<if test="component != null and component != ''">#{component},</if>
|
||||
<if test="query != null and query != ''">#{query},</if>
|
||||
<if test="isFrame != null and isFrame != ''">#{isFrame},</if>
|
||||
<if test="isCache != null and isCache != ''">#{isCache},</if>
|
||||
<if test="menuType != null and menuType != ''">#{menuType},</if>
|
||||
<if test="visible != null">#{visible},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="perms !=null and perms != ''">#{perms},</if>
|
||||
<if test="icon != null and icon != ''">#{icon},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteMenuById" parameterType="Long">
|
||||
delete from sys_menu where menu_id = #{menuId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?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.ruoyi.system.mapper.SysNoticeMapper">
|
||||
|
||||
<resultMap type="SysNotice" id="SysNoticeResult">
|
||||
<result property="noticeId" column="notice_id" />
|
||||
<result property="noticeTitle" column="notice_title" />
|
||||
<result property="noticeType" column="notice_type" />
|
||||
<result property="noticeContent" column="notice_content" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectNoticeVo">
|
||||
select notice_id, notice_title, notice_type, cast(notice_content as char) as notice_content, status, create_by, create_time, update_by, update_time, remark
|
||||
from sys_notice
|
||||
</sql>
|
||||
|
||||
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
|
||||
<include refid="selectNoticeVo"/>
|
||||
where notice_id = #{noticeId}
|
||||
</select>
|
||||
|
||||
<select id="selectNoticeList" parameterType="SysNotice" resultMap="SysNoticeResult">
|
||||
<include refid="selectNoticeVo"/>
|
||||
<where>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">
|
||||
AND notice_title like concat('%', #{noticeTitle}, '%')
|
||||
</if>
|
||||
<if test="noticeType != null and noticeType != ''">
|
||||
AND notice_type = #{noticeType}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND create_by like concat('%', #{createBy}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertNotice" parameterType="SysNotice">
|
||||
insert into sys_notice (
|
||||
<if test="noticeTitle != null and noticeTitle != '' ">notice_title, </if>
|
||||
<if test="noticeType != null and noticeType != '' ">notice_type, </if>
|
||||
<if test="noticeContent != null and noticeContent != '' ">notice_content, </if>
|
||||
<if test="status != null and status != '' ">status, </if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle}, </if>
|
||||
<if test="noticeType != null and noticeType != ''">#{noticeType}, </if>
|
||||
<if test="noticeContent != null and noticeContent != ''">#{noticeContent}, </if>
|
||||
<if test="status != null and status != ''">#{status}, </if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateNotice" parameterType="SysNotice">
|
||||
update sys_notice
|
||||
<set>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle}, </if>
|
||||
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType}, </if>
|
||||
<if test="noticeContent != null">notice_content = #{noticeContent}, </if>
|
||||
<if test="status != null and status != ''">status = #{status}, </if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where notice_id = #{noticeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteNoticeById" parameterType="Long">
|
||||
delete from sys_notice where notice_id = #{noticeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteNoticeByIds" parameterType="Long">
|
||||
delete from sys_notice where notice_id in
|
||||
<foreach item="noticeId" collection="array" open="(" separator="," close=")">
|
||||
#{noticeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?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.ruoyi.system.mapper.SysOperLogMapper">
|
||||
|
||||
<resultMap type="SysOperLog" id="SysOperLogResult">
|
||||
<id property="operId" column="oper_id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="businessType" column="business_type" />
|
||||
<result property="method" column="method" />
|
||||
<result property="requestMethod" column="request_method" />
|
||||
<result property="operatorType" column="operator_type" />
|
||||
<result property="operName" column="oper_name" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="operUrl" column="oper_url" />
|
||||
<result property="operIp" column="oper_ip" />
|
||||
<result property="operLocation" column="oper_location" />
|
||||
<result property="operParam" column="oper_param" />
|
||||
<result property="jsonResult" column="json_result" />
|
||||
<result property="status" column="status" />
|
||||
<result property="errorMsg" column="error_msg" />
|
||||
<result property="operTime" column="oper_time" />
|
||||
<result property="costTime" column="cost_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOperLogVo">
|
||||
select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time, cost_time
|
||||
from sys_oper_log
|
||||
</sql>
|
||||
|
||||
<insert id="insertOperlog" parameterType="SysOperLog">
|
||||
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time)
|
||||
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, sysdate())
|
||||
</insert>
|
||||
|
||||
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
||||
<include refid="selectOperLogVo"/>
|
||||
<where>
|
||||
<if test="operIp != null and operIp != ''">
|
||||
AND oper_ip like concat('%', #{operIp}, '%')
|
||||
</if>
|
||||
<if test="title != null and title != ''">
|
||||
AND title like concat('%', #{title}, '%')
|
||||
</if>
|
||||
<if test="businessType != null">
|
||||
AND business_type = #{businessType}
|
||||
</if>
|
||||
<if test="businessTypes != null and businessTypes.length > 0">
|
||||
AND business_type in
|
||||
<foreach collection="businessTypes" item="businessType" open="(" separator="," close=")">
|
||||
#{businessType}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="operName != null and operName != ''">
|
||||
AND oper_name like concat('%', #{operName}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND oper_time >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND oper_time <= #{params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
order by oper_id desc
|
||||
</select>
|
||||
|
||||
<delete id="deleteOperLogByIds" parameterType="Long">
|
||||
delete from sys_oper_log where oper_id in
|
||||
<foreach collection="array" item="operId" open="(" separator="," close=")">
|
||||
#{operId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectOperLogById" parameterType="Long" resultMap="SysOperLogResult">
|
||||
<include refid="selectOperLogVo"/>
|
||||
where oper_id = #{operId}
|
||||
</select>
|
||||
|
||||
<update id="cleanOperLog">
|
||||
truncate table sys_oper_log
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
122
ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml
Normal file
122
ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml
Normal file
@@ -0,0 +1,122 @@
|
||||
<?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.ruoyi.system.mapper.SysPostMapper">
|
||||
|
||||
<resultMap type="SysPost" id="SysPostResult">
|
||||
<id property="postId" column="post_id" />
|
||||
<result property="postCode" column="post_code" />
|
||||
<result property="postName" column="post_name" />
|
||||
<result property="postSort" column="post_sort" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPostVo">
|
||||
select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
|
||||
from sys_post
|
||||
</sql>
|
||||
|
||||
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
<where>
|
||||
<if test="postCode != null and postCode != ''">
|
||||
AND post_code like concat('%', #{postCode}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="postName != null and postName != ''">
|
||||
AND post_name like concat('%', #{postName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPostAll" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_id = #{postId}
|
||||
</select>
|
||||
|
||||
<select id="selectPostListByUserId" parameterType="Long" resultType="Long">
|
||||
select p.post_id
|
||||
from sys_post p
|
||||
left join sys_user_post up on up.post_id = p.post_id
|
||||
left join sys_user u on u.user_id = up.user_id
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
|
||||
select p.post_id, p.post_name, p.post_code
|
||||
from sys_post p
|
||||
left join sys_user_post up on up.post_id = p.post_id
|
||||
left join sys_user u on u.user_id = up.user_id
|
||||
where u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_name=#{postName} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_code=#{postCode} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updatePost" parameterType="SysPost">
|
||||
update sys_post
|
||||
<set>
|
||||
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
||||
<if test="postName != null and postName != ''">post_name = #{postName},</if>
|
||||
<if test="postSort != null">post_sort = #{postSort},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where post_id = #{postId}
|
||||
</update>
|
||||
|
||||
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
||||
insert into sys_post(
|
||||
<if test="postId != null and postId != 0">post_id,</if>
|
||||
<if test="postCode != null and postCode != ''">post_code,</if>
|
||||
<if test="postName != null and postName != ''">post_name,</if>
|
||||
<if test="postSort != null">post_sort,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="postId != null and postId != 0">#{postId},</if>
|
||||
<if test="postCode != null and postCode != ''">#{postCode},</if>
|
||||
<if test="postName != null and postName != ''">#{postName},</if>
|
||||
<if test="postSort != null">#{postSort},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deletePostById" parameterType="Long">
|
||||
delete from sys_post where post_id = #{postId}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePostByIds" parameterType="Long">
|
||||
delete from sys_post where post_id in
|
||||
<foreach collection="array" item="postId" open="(" separator="," close=")">
|
||||
#{postId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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.ruoyi.system.mapper.SysRoleDeptMapper">
|
||||
|
||||
<resultMap type="SysRoleDept" id="SysRoleDeptResult">
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteRoleDeptByRoleId" parameterType="Long">
|
||||
delete from sys_role_dept where role_id=#{roleId}
|
||||
</delete>
|
||||
|
||||
<select id="selectCountRoleDeptByDeptId" resultType="Integer">
|
||||
select count(1) from sys_role_dept where dept_id=#{deptId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteRoleDept" parameterType="Long">
|
||||
delete from sys_role_dept where role_id in
|
||||
<foreach collection="array" item="roleId" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchRoleDept">
|
||||
insert into sys_role_dept(role_id, dept_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.roleId},#{item.deptId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
152
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
Normal file
152
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
Normal file
@@ -0,0 +1,152 @@
|
||||
<?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.ruoyi.system.mapper.SysRoleMapper">
|
||||
|
||||
<resultMap type="SysRole" id="SysRoleResult">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
<result property="roleSort" column="role_sort" />
|
||||
<result property="dataScope" column="data_scope" />
|
||||
<result property="menuCheckStrictly" column="menu_check_strictly" />
|
||||
<result property="deptCheckStrictly" column="dept_check_strictly" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRoleVo">
|
||||
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
|
||||
r.status, r.del_flag, r.create_time, r.remark
|
||||
from sys_role r
|
||||
left join sys_user_role ur on ur.role_id = r.role_id
|
||||
left join sys_user u on u.user_id = ur.user_id
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.del_flag = '0'
|
||||
<if test="roleId != null and roleId != 0">
|
||||
AND r.role_id = #{roleId}
|
||||
</if>
|
||||
<if test="roleName != null and roleName != ''">
|
||||
AND r.role_name like concat('%', #{roleName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND r.status = #{status}
|
||||
</if>
|
||||
<if test="roleKey != null and roleKey != ''">
|
||||
AND r.role_key like concat('%', #{roleKey}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(r.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
order by r.role_sort
|
||||
</select>
|
||||
|
||||
<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
WHERE r.del_flag = '0' and ur.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectRoleAll" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectRoleListByUserId" parameterType="Long" resultType="Long">
|
||||
select r.role_id
|
||||
from sys_role r
|
||||
left join sys_user_role ur on ur.role_id = r.role_id
|
||||
left join sys_user u on u.user_id = ur.user_id
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
WHERE r.del_flag = '0' and u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_name=#{roleName} and r.del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
||||
<include refid="selectRoleVo"/>
|
||||
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||
insert into sys_role(
|
||||
<if test="roleId != null and roleId != 0">role_id,</if>
|
||||
<if test="roleName != null and roleName != ''">role_name,</if>
|
||||
<if test="roleKey != null and roleKey != ''">role_key,</if>
|
||||
<if test="roleSort != null">role_sort,</if>
|
||||
<if test="dataScope != null and dataScope != ''">data_scope,</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly,</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="roleId != null and roleId != 0">#{roleId},</if>
|
||||
<if test="roleName != null and roleName != ''">#{roleName},</if>
|
||||
<if test="roleKey != null and roleKey != ''">#{roleKey},</if>
|
||||
<if test="roleSort != null">#{roleSort},</if>
|
||||
<if test="dataScope != null and dataScope != ''">#{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">#{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">#{deptCheckStrictly},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateRole" parameterType="SysRole">
|
||||
update sys_role
|
||||
<set>
|
||||
<if test="roleName != null and roleName != ''">role_name = #{roleName},</if>
|
||||
<if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if>
|
||||
<if test="roleSort != null">role_sort = #{roleSort},</if>
|
||||
<if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if>
|
||||
<if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if>
|
||||
<if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where role_id = #{roleId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRoleById" parameterType="Long">
|
||||
update sys_role set del_flag = '2' where role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRoleByIds" parameterType="Long">
|
||||
update sys_role set del_flag = '2' where role_id in
|
||||
<foreach collection="array" item="roleId" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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.ruoyi.system.mapper.SysRoleMenuMapper">
|
||||
|
||||
<resultMap type="SysRoleMenu" id="SysRoleMenuResult">
|
||||
<result property="roleId" column="role_id" />
|
||||
<result property="menuId" column="menu_id" />
|
||||
</resultMap>
|
||||
|
||||
<select id="checkMenuExistRole" resultType="Integer">
|
||||
select count(1) from sys_role_menu where menu_id = #{menuId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteRoleMenuByRoleId" parameterType="Long">
|
||||
delete from sys_role_menu where role_id=#{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRoleMenu" parameterType="Long">
|
||||
delete from sys_role_menu where role_id in
|
||||
<foreach collection="array" item="roleId" open="(" separator="," close=")">
|
||||
#{roleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchRoleMenu">
|
||||
insert into sys_role_menu(role_id, menu_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.roleId},#{item.menuId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
231
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
Normal file
231
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
Normal file
@@ -0,0 +1,231 @@
|
||||
<?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.ruoyi.system.mapper.SysUserMapper">
|
||||
|
||||
<resultMap type="SysUser" id="SysUserResult">
|
||||
<id property="userId" column="user_id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="email" column="email" />
|
||||
<result property="phonenumber" column="phonenumber" />
|
||||
<result property="sex" column="sex" />
|
||||
<result property="avatar" column="avatar" />
|
||||
<result property="password" column="password" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="loginIp" column="login_ip" />
|
||||
<result property="loginDate" column="login_date" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="openId" column="open_id" />
|
||||
<result property="integral" column="integral" />
|
||||
<association property="dept" javaType="SysDept" resultMap="deptResult" />
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="deptResult" type="SysDept">
|
||||
<id property="deptId" column="dept_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="ancestors" column="ancestors" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
<result property="leader" column="leader" />
|
||||
<result property="status" column="dept_status" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="RoleResult" type="SysRole">
|
||||
<id property="roleId" column="role_id" />
|
||||
<result property="roleName" column="role_name" />
|
||||
<result property="roleKey" column="role_key" />
|
||||
<result property="roleSort" column="role_sort" />
|
||||
<result property="dataScope" column="data_scope" />
|
||||
<result property="status" column="role_status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.integral,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_statusselectUserVo, u.open_id as openId
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,u.integral, d.dept_name, d.leader from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
<if test="userId != null and userId != 0">
|
||||
AND u.user_id = #{userId}
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND u.status = #{status}
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="deptId != null and deptId != 0">
|
||||
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
where u.del_flag = '0' and r.role_id = #{roleId}
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
where u.del_flag = '0' and (r.role_id != #{roleId} or r.role_id IS NULL)
|
||||
and u.user_id not in (select u.user_id from sys_user u inner join sys_user_role ur on u.user_id = ur.user_id and ur.role_id = #{roleId})
|
||||
<if test="userName != null and userName != ''">
|
||||
AND u.user_name like concat('%', #{userName}, '%')
|
||||
</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">
|
||||
AND u.phonenumber like concat('%', #{phonenumber}, '%')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
||||
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_name = #{userName} and u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectUserByIdOpenid" parameterType="String" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.open_id = #{openId} and u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
|
||||
insert into sys_user(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="avatar != null and avatar != ''">avatar,</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
|
||||
<if test="sex != null and sex != ''">sex,</if>
|
||||
<if test="password != null and password != ''">password,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="openId != null and openId != ''">open_id,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
<if test="deptId != null and deptId != ''">#{deptId},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||
<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">#{sex},</if>
|
||||
<if test="password != null and password != ''">#{password},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="openId != null and openId != ''">#{openId},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateUser" parameterType="SysUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||
<if test="email != null ">email = #{email},</if>
|
||||
<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
|
||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
|
||||
<if test="password != null and password != ''">password = #{password},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
|
||||
<if test="loginDate != null">login_date = #{loginDate},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="integral != null and userName != null">integral = #{integral},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserStatus" parameterType="SysUser">
|
||||
update sys_user set status = #{status} where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateUserAvatar" parameterType="SysUser">
|
||||
update sys_user set avatar = #{avatar} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
<update id="resetUserPwd" parameterType="SysUser">
|
||||
update sys_user set password = #{password} where user_name = #{userName}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUserById" parameterType="Long">
|
||||
update sys_user set del_flag = '2' where user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUserByIds" parameterType="Long">
|
||||
update sys_user set del_flag = '2' where user_id in
|
||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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.ruoyi.system.mapper.SysUserPostMapper">
|
||||
|
||||
<resultMap type="SysUserPost" id="SysUserPostResult">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="postId" column="post_id" />
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteUserPostByUserId" parameterType="Long">
|
||||
delete from sys_user_post where user_id=#{userId}
|
||||
</delete>
|
||||
|
||||
<select id="countUserPostById" resultType="Integer">
|
||||
select count(1) from sys_user_post where post_id=#{postId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteUserPost" parameterType="Long">
|
||||
delete from sys_user_post where user_id in
|
||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchUserPost">
|
||||
insert into sys_user_post(user_id, post_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.userId},#{item.postId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?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.ruoyi.system.mapper.SysUserRoleMapper">
|
||||
|
||||
<resultMap type="SysUserRole" id="SysUserRoleResult">
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="roleId" column="role_id" />
|
||||
</resultMap>
|
||||
|
||||
<delete id="deleteUserRoleByUserId" parameterType="Long">
|
||||
delete from sys_user_role where user_id=#{userId}
|
||||
</delete>
|
||||
|
||||
<select id="countUserRoleByRoleId" resultType="Integer">
|
||||
select count(1) from sys_user_role where role_id=#{roleId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteUserRole" parameterType="Long">
|
||||
delete from sys_user_role where user_id in
|
||||
<foreach collection="array" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="batchUserRole">
|
||||
insert into sys_user_role(user_id, role_id) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.userId},#{item.roleId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteUserRoleInfo" parameterType="SysUserRole">
|
||||
delete from sys_user_role where user_id=#{userId} and role_id=#{roleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteUserRoleInfos">
|
||||
delete from sys_user_role where role_id=#{roleId} and user_id in
|
||||
<foreach collection="userIds" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user