12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?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.demo.mapper.WdInfoMapper">
- <resultMap type="com.ruoyi.demo.entity.vo.AddStatusVo" id="AddStatusResult">
- <result property="typeCode" column="wd_type_code"/>
- <result property="count" column="count"/>
- <result property="time" column="time"/>
- </resultMap>
- <select id="list" parameterType="com.ruoyi.demo.entity.vo.WdInfoVo" resultType="com.ruoyi.demo.entity.WdInfo">
- select * from ddt_wd_info
- <where>
- <if test="wd.wdName != null and wd.wdName != ''">
- and wd_name like concat("%",#{wd.wdName},"%")
- </if>
- <if test="wd.typeCodeBy != null and wd.typeCodeBy != ''">
- and type_code_by = #{wd.typeCodeBy}
- </if>
- <if test="wd.addrCode != null and wd.addrCode != ''">
- and addr_code = #{wd.addrCode}
- </if>
- <if test="wd.showDelete != -1">
- and show_delete = #{wd.showDelete}
- </if>
- </where>
- </select>
- <select id="searchAddStatusByMulti" resultMap="AddStatusResult">
- SELECT
- wd_type_code,
- COUNT(*) count,
- DATE_FORMAT(collect_time, "%Y-%m") time
- FROM
- `ddt_wd_info`
- <trim prefix="where" prefixOverrides="and">
- <if test="times != null">
- <foreach collection="times" item="time" open="and DATE_FORMAT(collect_time, '%Y-%m') IN (" separator="," close=")">
- #{time,jdbcType=VARCHAR}
- </foreach>
- </if>
- <if test="addrCodes != null">
- <foreach collection="addrCodes" item="addrCode" open="and addr_code IN (" separator="," close=")">
- #{addrCode,jdbcType=VARCHAR}
- </foreach>
- </if>
- <if test="wdTypeCodes != null">
- <foreach collection="wdTypeCodes" item="type" open="and wd_type_code IN (" separator="," close=")">
- #{type,jdbcType=VARCHAR}
- </foreach>
- </if>
- </trim>
- GROUP BY
- wd_type_code,
- time
- </select>
- <update id="recoverWd" parameterType="java.lang.String">
- update ddt_wd_info set show_delete = 0 where wd_id = #{wdId}
- </update>
- <select id="selectChannel" resultType="com.ruoyi.demo.entity.vo.ChannelVo">
- SELECT
- dwi.wd_img,
- dwi.wd_name,
- dsw.contact,
- dsw.telephone,
- channel_type
- FROM
- `ddt_store_wd` dsw
- LEFT JOIN `ddt_wd_info` dwi ON dwi.wd_id = dsw.wd_id ${ew.customSqlSegment}
- </select>
- </mapper>
|