| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <?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="cn.com.goldenwater.dcproj.dao.BisInspMtprgSmsDao">
- <resultMap type="cn.com.goldenwater.dcproj.model.BisInspMtprgSms" id="bisInspMtprgSmsResultMap">
- <result property="id" column="ID"/>
- <result property="userId" column="USER_ID"/>
- <result property="userName" column="USER_NAME"/>
- <result property="phone" column="PHONE"/>
- <result property="isRemind" column="IS_REMIND"/>
- <result property="intm" column="INTM"/>
- <result property="uptm" column="UPTM"/>
- <result property="createrId" column="CREATER_ID"/>
- <result property="orgId" column="ORG_ID"/>
- </resultMap>
- <sql id="table_columns">
- ID,
- USER_ID,
- USER_NAME,
- PHONE,
- IS_REMIND,
- INTM,
- UPTM,
- ORG_ID,
- CREATER_ID
- </sql>
- <sql id="table_columns2">
- S.ID,
- S.USER_ID,
- S.USER_NAME,
- S.IS_REMIND,
- S.INTM,
- S.UPTM,
- S.CREATER_ID,
- P.CALLNUMBER,
- P.PROVINCE,
- P.DEPART_ID,
- P.DEPART_NM,
- P.DPNM,
- P.DPPOST,
- P.IDNM,
- P.PLST,
- P.SCHOOL,
- P.SPECIALTY,
- P.IMGURL,
- P.GUID,
- P.PERS_NAME,
- P.PWD,
- P.SEX,
- P.TELNUMB,
- P.FAXNUMB,
- P.MOBILENUMB,
- P.EMAIL,
- P.BORN_DATE,
- P.ORG_ID,
- P.ORG_NM,
- P.ADM_DUTY,
- P.COLL_TIME,
- P.REMARK,
- P.PERS_TYPE,
- P.PERMISSION,
- P.OWNER_SYSTEM,
- P.W_UNIT,
- O.ORG_NM AS ORG_NAME
- </sql>
- <sql id="entity_properties">
- #{id},
- #{userId},
- #{userName},
- #{phone},
- #{isRemind},
- #{intm},
- #{uptm},
- #{orgId},
- #{createrId}
- </sql>
- <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
- <sql id="page_where">
- <trim prefix="where" prefixOverrides="and | or ">
- <if test="userId != null and userId != ''">and USER_ID = #{userId}</if>
- <if test="orgId != null and orgId != ''">and ORG_ID = #{orgId}</if>
- <if test="userName != null and userName != ''">and USER_NAME = #{userName}</if>
- <if test="phone != null and phone != ''">and PHONE = #{phone}</if>
- <if test="isRemind != null and isRemind != ''">and IS_REMIND = #{isRemind}</if>
- <if test="intm != null">and INTM = #{intm}</if>
- <if test="createrId != null and createrId != ''">and CREATER_ID = #{createrId}</if>
- </trim>
- </sql>
- <select id="get" resultMap="bisInspMtprgSmsResultMap" parameterType="String">
- select
- <include refid="table_columns"/>
- from BIS_INSP_MTPRG_SMS where ID = #{id}
- </select>
- <select id="getBy" resultMap="bisInspMtprgSmsResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_MTPRG_SMS
- <include refid="page_where"/>
- </select>
- <select id="findAll" resultMap="bisInspMtprgSmsResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_MTPRG_SMS
- </select>
- <select id="findList" resultMap="bisInspMtprgSmsResultMap">
- select
- <include refid="table_columns"/>
- from BIS_INSP_MTPRG_SMS
- <include refid="page_where"/>
- </select>
- <select id="selectCount" resultType="int">
- select count(ID) from BIS_INSP_MTPRG_SMS
- <include refid="page_where"/>
- </select>
- <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.BisInspMtprgSms">
- insert into BIS_INSP_MTPRG_SMS(
- <include refid="table_columns"/>
- )
- values (
- <include refid="entity_properties"/>
- )
- </insert>
- <delete id="delete" parameterType="java.lang.String">
- delete from BIS_INSP_MTPRG_SMS where ID = #{id}
- </delete>
- <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspMtprgSms">
- update BIS_INSP_MTPRG_SMS set DATA_STAT='9'
- <include refid="page_where"/>
- </delete>
- <update id="deleteInFlag" parameterType="java.lang.String">
- update BIS_INSP_MTPRG_SMS set DATA_STAT = '9' where ID = #{id}
- </update>
- <update id="update" parameterType="cn.com.goldenwater.dcproj.model.BisInspMtprgSms">
- update BIS_INSP_MTPRG_SMS
- <trim prefix="set" suffixOverrides=",">
- <if test="userId != null and userId != ''">USER_ID = #{userId},</if>
- <if test="userName != null and userName != ''">USER_NAME = #{userName},</if>
- <if test="phone != null and phone != ''">PHONE = #{phone},</if>
- <if test="isRemind != null and isRemind != ''">IS_REMIND = #{isRemind},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="createrId != null and createrId != ''">CREATER_ID = #{createrId},</if>
- </trim>
- <where>ID = #{id}</where>
- </update>
- <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.BisInspMtprgSms">
- update BIS_INSP_MTPRG_SMS
- <trim prefix="set" suffixOverrides=",">
- <if test="userId != null and userId != ''">USER_ID = #{userId},</if>
- <if test="userName != null and userName != ''">USER_NAME = #{userName},</if>
- <if test="phone != null and phone != ''">PHONE = #{phone},</if>
- <if test="isRemind != null and isRemind != ''">IS_REMIND = #{isRemind},</if>
- <if test="intm != null">INTM = #{intm},</if>
- <if test="uptm != null">UPTM = #{uptm},</if>
- <if test="createrId != null and createrId != ''">CREATER_ID = #{createrId},</if>
- </trim>
- <include refid="page_where"/>
- </update>
- <!-- 其他自定义SQL -->
- <select id="listByNotMonthReport" resultType="cn.com.goldenwater.dcproj.model.BisInspAllRlationPers">
- select distinct P.*
- from BIS_INSP_ALL_RLATION_PERS P
- JOIN (
- SELECT *
- FROM BIS_INSP_PERS_ORG G
- WHERE ORG_ID = #{orgId}
- ) G ON P.GUID=G.PERS_ID
- <where>
- P.GUID NOT IN (SELECT USER_ID FROM BIS_INSP_MTPRG_SMS where ORG_ID = #{orgId})
- <if test="dpnm != null and dpnm != ''">AND P.DPNM like CONCAT('%', CONCAT(#{dpnm}, '%'))</if>
- <if test="userName != null and userName != ''">and P.PERS_NAME LIKE CONCAT('%', CONCAT(#{userName},'%'))
- </if>
- <if test="name != null and name != ''">and P.PERS_NAME LIKE CONCAT('%', CONCAT(#{name},'%'))</if>
- <if test="phone != null and phone != ''">and P.MOBILENUMB LIKE CONCAT('%', CONCAT(#{phone},'%'))</if>
- </where>
- </select>
- <!-- 其他自定义SQL -->
- <select id="list" resultType="cn.com.goldenwater.dcproj.vo.BisInspMtprgSmsVo">
- select
- <include refid="table_columns2"/>
- from BIS_INSP_MTPRG_SMS S
- JOIN BIS_INSP_ALL_RLATION_PERS P ON S.USER_ID = P.GUID
- LEFT JOIN BIS_INSP_ORG O ON O.ORG_ID = P.ORG_ID
- <where>
- S.USER_ID IN ( SELECT PERS_ID FROM BIS_INSP_PERS_ORG
- <if test="orgId != null and orgId != ''">WHERE ORG_ID = #{orgId}</if>
- )
- <if test="orgId != null and orgId != ''">AND S.ORG_ID = #{orgId}</if>
- <if test="dpnm != null and dpnm != ''">AND P.DPNM like CONCAT('%', CONCAT(#{dpnm}, '%'))</if>
- <if test="userName != null and userName != ''">and S.USER_NAME like CONCAT('%', CONCAT(#{userName}, '%'))
- </if>
- <if test="name != null and name != ''">and S.USER_NAME LIKE CONCAT('%', CONCAT(#{name},'%'))</if>
- <if test="phone != null and phone != ''">and S.PHONE LIKE CONCAT('%', CONCAT(#{phone},'%'))</if>
- <if test="isRemind != null and isRemind != ''">and S.IS_REMIND = #{isRemind}</if>
- <if test="createrId != null and createrId != ''">and S.CREATER_ID = #{createrId}</if>
- </where>
- </select>
- </mapper>
|