123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- <?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.zhyc.xps.lylc.mapper.AssessRecordMapper">
- <resultMap id="AssessRecordDtoMap" type="com.zhyc.xps.lylc.dto.AssessRecordDto">
- <result column="oc_id" property="ocId" jdbcType="BIGINT" />
- <result column="group_id" property="groupId" jdbcType="BIGINT" />
- <result column="group_name" property="groupName" jdbcType="VARCHAR" />
- <result column="position_id" property="positionId" jdbcType="BIGINT" />
- <result column="position_name" property="positionName" jdbcType="VARCHAR" />
- <result column="account_id" property="accountId" jdbcType="BIGINT" />
- <result column="account_name" property="accountName" jdbcType="VARCHAR" />
- <result column="record_id" property="recordId" jdbcType="BIGINT" />
- <result column="target_oc_id" property="targetOcId" jdbcType="BIGINT" />
- <result column="event" property="event" jdbcType="VARCHAR" />
- <result column="story_id" property="storyId" jdbcType="BIGINT" />
- <result column="target_id" property="targetId" jdbcType="BIGINT" />
- <result column="item_id" property="itemId" jdbcType="BIGINT" />
- <result column="point_id" property="pointId" jdbcType="BIGINT" />
- <result column="score" property="score" jdbcType="DOUBLE" />
- <result column="assess_time" property="assessTime" jdbcType="DATE" />
- <result column="remark" property="remark" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="AssessRecordDto_Cols">
- A.oc_id,
- A.group_id,
- B.group_name,
- A.position_id,
- C.position_name,
- A.account_id,
- D.account_name,
- D.account_real_name,
- D.account_avatar,
- A.record_id,
- A.target_oc_id,
- A.event,
- A.story_id,
- A.target_id,
- A.item_id,
- A.point_id,
- A.score,
- A.assess_time,
- A.remark
- </sql>
- <!--基于ID查询-->
- <select id="getById" resultMap="AssessRecordDtoMap">
- SELECT
- <include refid="AssessRecordDto_Cols"/>
- FROM hos_assess_record AS A
- LEFT JOIN s_group AS B ON (A.oc_id = B.oc_id AND A.group_id = B.group_id)
- LEFT JOIN s_position AS C ON (A.oc_id = C.oc_id AND A.position_id = C.position_id)
- LEFT JOIN account AS D ON (A.oc_id = D.oc_id AND A.account_id = D.account_id)
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="recordId != null">
- AND A.record_id = #{recordId ,jdbcType=BIGINT}
- </if>
- <if test="storyId != null">
- AND A.story_id = #{storyId ,jdbcType=BIGINT}
- </if>
- <if test="targetId != null">
- AND A.target_id = #{targetId ,jdbcType=BIGINT}
- </if>
- <if test="itemId != null">
- AND A.item_id = #{itemId ,jdbcType=BIGINT}
- </if>
- <if test="pointId != null">
- AND A.point_id = #{pointId ,jdbcType=BIGINT}
- </if>
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="AssessRecordDtoMap">
- SELECT
- <include refid="AssessRecordDto_Cols"/>
- FROM hos_assess_record AS A
- LEFT JOIN s_group AS B ON (A.oc_id = B.oc_id AND A.group_id = B.group_id)
- LEFT JOIN s_position AS C ON (A.oc_id = C.oc_id AND A.position_id = C.position_id)
- LEFT JOIN account AS D ON (A.oc_id = D.oc_id AND A.account_id = D.account_id)
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="storyId != null">
- AND A.story_id = #{storyId ,jdbcType=BIGINT}
- </if>
- <if test="targetId != null">
- AND A.target_id = #{targetId ,jdbcType=BIGINT}
- </if>
- <if test="itemId != null">
- AND A.item_id = #{itemId ,jdbcType=BIGINT}
- </if>
- <if test="pointId != null">
- AND A.point_id = #{pointId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.event like "%"#{keywords}"%"
- </if>
- ORDER BY A.assess_time DESC
- </select>
- <!--列表查询-->
- <select id="getByList" parameterType="java.util.Map" resultMap="AssessRecordDtoMap" >
- SELECT
- <include refid="AssessRecordDto_Cols"/>
- FROM hos_assess_record AS A
- LEFT JOIN s_group AS B ON (A.oc_id = B.oc_id AND A.group_id = B.group_id)
- LEFT JOIN s_position AS C ON (A.oc_id = C.oc_id AND A.position_id = C.position_id)
- LEFT JOIN account AS D ON (A.oc_id = D.oc_id AND A.account_id = D.account_id)
- WHERE A.deleted_flag = 0
- <if test="ocId != null">
- AND A.oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="storyId != null">
- AND A.story_id = #{storyId ,jdbcType=BIGINT}
- </if>
- <if test="targetId != null">
- AND A.target_id = #{targetId ,jdbcType=BIGINT}
- </if>
- <if test="itemId != null">
- AND A.item_id = #{itemId ,jdbcType=BIGINT}
- </if>
- <if test="pointId != null">
- AND A.point_id = #{pointId ,jdbcType=BIGINT}
- </if>
- <if test="keywords != null and keywords != ''">
- AND A.event like "%"#{keywords}"%"
- </if>
- <if test="year != null">
- AND year(A.assess_time) = #{year ,jdbcType=BIGINT}
- </if>
- <if test="month != null">
- AND month(A.assess_time) = #{month ,jdbcType=BIGINT}
- </if>
- ORDER BY A.assess_time DESC
- </select>
- <insert id="create" parameterType="com.zhyc.xps.lylc.entity.AssessRecord">
- INSERT INTO hos_assess_record
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="groupId != null">
- group_id,
- </if>
- <if test="positionId != null">
- position_id,
- </if>
- <if test="accountId != null">
- account_id,
- </if>
- <if test="recordId != null">
- record_id,
- </if>
- <if test="event != null and event !=''">
- event,
- </if>
- <if test="targetOcId != null">
- target_oc_id,
- </if>
- <if test="storyId != null">
- story_id,
- </if>
- <if test="targetId != null">
- target_id,
- </if>
- <if test="itemId != null">
- item_id,
- </if>
- <if test="pointId != null">
- point_id,
- </if>
- <if test="score != null">
- score,
- </if>
- <if test="assessTime != null">
- assess_time,
- </if>
- <if test="remark != null and remark != ''">
- remark,
- </if>
- <if test="createdBy != null">
- created_by,
- </if>
- <if test="createdAt != null">
- created_at,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="ocId != null">
- #{ocId,jdbcType=BIGINT},
- </if>
- <if test="groupId != null">
- #{groupId, jdbcType=BIGINT},
- </if>
- <if test="positionId != null">
- #{positionId, jdbcType=BIGINT},
- </if>
- <if test="accountId != null">
- #{accountId, jdbcType=BIGINT},
- </if>
- <if test="recordId != null">
- #{recordId, jdbcType=BIGINT},
- </if>
- <if test="event != null and event !=''">
- #{event, jdbcType=VARCHAR},
- </if>
- <if test="targetOcId != null">
- #{targetOcId, jdbcType=BIGINT},
- </if>
- <if test="storyId != null">
- #{storyId ,jdbcType=BIGINT},
- </if>
- <if test="targetId != null">
- #{targetId ,jdbcType=BIGINT},
- </if>
- <if test="itemId != null">
- #{itemId ,jdbcType=BIGINT},
- </if>
- <if test="pointId != null">
- #{pointId ,jdbcType=BIGINT},
- </if>
- <if test="score != null">
- #{score ,jdbcType=DOUBLE},
- </if>
- <if test="assessTime != null">
- #{assessTime ,jdbcType=TIMESTAMP},
- </if>
- <if test="remark != null and remark != ''">
- #{remark ,jdbcType=VARCHAR},
- </if>
- <if test="createdBy != null">
- #{createdBy ,jdbcType=BIGINT},
- </if>
- <if test="createdAt != null">
- #{createdAt ,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <!--删除-->
- <update id="delete" parameterType="java.util.Map">
- UPDATE hos_assess_record
- <trim suffixOverrides=",">
- <set>
- <if test="deletedFlag != null">
- deleted_flag = #{deletedFlag,jdbcType=BIGINT},
- </if>
- <if test="deletedTime != null">
- deleted_time = #{deletedTime,jdbcType=TIMESTAMP},
- </if>
- <if test="deletedBy != null">
- deleted_by = #{deletedBy,jdbcType=BIGINT},
- </if>
- </set>
- </trim>
- WHERE 1 = 1
- <if test="ocId != null">
- AND oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="recordId != null">
- AND record_id = #{recordId ,jdbcType=BIGINT}
- </if>
- <if test="storyId != null">
- AND story_id = #{storyId ,jdbcType=BIGINT}
- </if>
- <if test="targetId != null">
- AND target_id = #{targetId ,jdbcType=BIGINT}
- </if>
- <if test="itemId != null">
- AND item_id = #{itemId ,jdbcType=BIGINT},
- </if>
- <if test="pointId != null">
- AND point_id = #{pointId ,jdbcType=BIGINT}
- </if>
- </update>
- </mapper>
|