<?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.gkhy.safePlatform.equipment.repository.MaterialReceiveRecordsBaseInfoRepository">
|
|
<resultMap type="com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseInfo" id="resultMap">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="material_name" property="materialName" jdbcType="VARCHAR"/>
|
<result column="receive_uid" property="receiveId" jdbcType="BIGINT"/>
|
<result column="receive_uname" property="receiveName" jdbcType="VARCHAR"/>
|
<result column="receive_count" property="receiveCount" jdbcType="INTEGER"/>
|
<result column="revert_count" property="revertCount" jdbcType="INTEGER"/>
|
<result column="consume_count" property="consumeCount" jdbcType="INTEGER"/>
|
<result column="status" property="status" jdbcType="TINYINT"/>
|
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
<result column="sm_id" property="smId" jdbcType="BIGINT"/>
|
<result column="del_flag" property="delFlag" jdbcType="INTEGER"/>
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
<result column="create_uid" property="createUid" jdbcType="BIGINT"/>
|
<result column="create_uname" property="createUname" jdbcType="VARCHAR"/>
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
<result column="update_uid" property="updateUid" jdbcType="BIGINT"/>
|
<result column="update_uname" property="updateUname" jdbcType="VARCHAR"/>
|
</resultMap>
|
<select id="listByConditions" resultType="com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseDO">
|
SELECT b.id,
|
b.material_name,
|
b.receive_uid,
|
b.receive_uname,
|
b.receive_count,
|
b.revert_count,
|
b.consume_count,
|
b.status,
|
b.remark,
|
b.create_time,
|
b.sm_id,
|
s.dep_id,
|
s.dep_name
|
from material_receive_records_base b
|
inner join safe_material s on b.sm_id = s.id
|
where b.del_flag = 0
|
<if test="query.materialName != null and query.materialName != '' ">
|
and instr(b.material_name,#{query.materialName})>0
|
</if>
|
<if test="query.receiveUname != null and query.receiveUname != '' ">
|
and instr(b.receive_uname,#{query.receiveUname})>0
|
</if>
|
<if test="query.depId != null">
|
and s.dep_id = #{query.depId}
|
</if>
|
<if test="query.startTime != null ">
|
and DATE_FORMAT(b.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{query.startTime},'%Y-%m-%d')
|
</if>
|
<if test="query.endTime != null ">
|
and DATE_FORMAT(b.create_time,'%Y-%m-%d') <= DATE_FORMAT(#{query.endTime},'%Y-%m-%d')
|
</if>
|
order by b.create_time desc
|
</select>
|
|
</mapper>
|