2024-08-28 20:54:03 +08:00
|
|
|
<?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.iocoder.yudao.module.inspection.mapper.InspectionInfoMapper">
|
|
|
|
|
|
|
|
<resultMap type="cn.iocoder.yudao.module.inspection.entity.InspectionInfo" id="InspectionInfoResult">
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="inspectionOrderId" column="inspection_order_id" />
|
|
|
|
<result property="workId" column="work_id" />
|
|
|
|
<result property="workerName" column="worker_name" />
|
|
|
|
<result property="workerPhone" column="worker_phone" />
|
|
|
|
<result property="isPass" column="is_pass" />
|
|
|
|
<result property="status" column="status" />
|
|
|
|
<result property="startTime" column="start_time" />
|
|
|
|
<result property="endTime" column="end_time" />
|
|
|
|
<result property="year" column="year" />
|
|
|
|
<result property="month" column="month" />
|
|
|
|
<result property="day" column="day" />
|
|
|
|
<result property="createTime" column="create_time" />
|
2024-08-31 00:08:49 +08:00
|
|
|
<result property="creator" column="creator" />
|
2024-08-28 20:54:03 +08:00
|
|
|
<result property="updateTime" column="update_time" />
|
2024-08-31 00:08:49 +08:00
|
|
|
<result property="updater" column="updater" />
|
2024-08-28 20:54:03 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectInspectionInfoVo">
|
2024-08-31 00:08:49 +08:00
|
|
|
select id, inspection_order_id, work_id, worker_name, worker_phone, is_pass, status, start_time, end_time, year, month, day, create_time, creator, update_time, updater from inspection_info
|
2024-08-28 20:54:03 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectInspectionInfoList" parameterType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo" resultMap="InspectionInfoResult">
|
|
|
|
<include refid="selectInspectionInfoVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="inspectionOrderId != null "> and inspection_order_id = #{inspectionOrderId}</if>
|
|
|
|
<if test="workId != null "> and work_id = #{workId}</if>
|
|
|
|
<if test="workerName != null and workerName != ''"> and worker_name like concat('%', #{workerName}, '%')</if>
|
|
|
|
<if test="workerPhone != null and workerPhone != ''"> and worker_phone = #{workerPhone}</if>
|
|
|
|
<if test="isPass != null and isPass != ''"> and is_pass = #{isPass}</if>
|
|
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
|
|
<if test="startTime != null "> and start_time = #{startTime}</if>
|
|
|
|
<if test="endTime != null "> and end_time = #{endTime}</if>
|
|
|
|
<if test="year != null and year != ''"> and year = #{year}</if>
|
|
|
|
<if test="month != null and month != ''"> and month = #{month}</if>
|
|
|
|
<if test="day != null and day != ''"> and day = #{day}</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectInspectionInfoById" parameterType="Long" resultMap="InspectionInfoResult">
|
|
|
|
<include refid="selectInspectionInfoVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertInspectionInfo" parameterType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
|
|
|
insert into inspection_info
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">id,</if>
|
|
|
|
<if test="inspectionOrderId != null">inspection_order_id,</if>
|
|
|
|
<if test="workId != null">work_id,</if>
|
|
|
|
<if test="workerName != null">worker_name,</if>
|
|
|
|
<if test="workerPhone != null">worker_phone,</if>
|
|
|
|
<if test="isPass != null">is_pass,</if>
|
|
|
|
<if test="status != null">status,</if>
|
|
|
|
<if test="startTime != null">start_time,</if>
|
|
|
|
<if test="endTime != null">end_time,</if>
|
|
|
|
<if test="year != null">year,</if>
|
|
|
|
<if test="month != null">month,</if>
|
|
|
|
<if test="day != null">day,</if>
|
|
|
|
<if test="createTime != null">create_time,</if>
|
2024-08-31 00:08:49 +08:00
|
|
|
<if test="creator != null">creator,</if>
|
2024-08-28 20:54:03 +08:00
|
|
|
<if test="updateTime != null">update_time,</if>
|
2024-08-31 00:08:49 +08:00
|
|
|
<if test="updater != null">updater,</if>
|
2024-08-28 20:54:03 +08:00
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null">#{id},</if>
|
|
|
|
<if test="inspectionOrderId != null">#{inspectionOrderId},</if>
|
|
|
|
<if test="workId != null">#{workId},</if>
|
|
|
|
<if test="workerName != null">#{workerName},</if>
|
|
|
|
<if test="workerPhone != null">#{workerPhone},</if>
|
|
|
|
<if test="isPass != null">#{isPass},</if>
|
|
|
|
<if test="status != null">#{status},</if>
|
|
|
|
<if test="startTime != null">#{startTime},</if>
|
|
|
|
<if test="endTime != null">#{endTime},</if>
|
|
|
|
<if test="year != null">#{year},</if>
|
|
|
|
<if test="month != null">#{month},</if>
|
|
|
|
<if test="day != null">#{day},</if>
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
2024-08-31 00:08:49 +08:00
|
|
|
<if test="creator != null">#{creator},</if>
|
2024-08-28 20:54:03 +08:00
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
2024-08-31 00:08:49 +08:00
|
|
|
<if test="updater != null">#{updater},</if>
|
2024-08-28 20:54:03 +08:00
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateInspectionInfo" parameterType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
|
|
|
update inspection_info
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="inspectionOrderId != null">inspection_order_id = #{inspectionOrderId},</if>
|
|
|
|
<if test="workId != null">work_id = #{workId},</if>
|
|
|
|
<if test="workerName != null">worker_name = #{workerName},</if>
|
|
|
|
<if test="workerPhone != null">worker_phone = #{workerPhone},</if>
|
|
|
|
<if test="isPass != null">is_pass = #{isPass},</if>
|
|
|
|
<if test="status != null">status = #{status},</if>
|
|
|
|
<if test="startTime != null">start_time = #{startTime},</if>
|
|
|
|
<if test="endTime != null">end_time = #{endTime},</if>
|
|
|
|
<if test="year != null">year = #{year},</if>
|
|
|
|
<if test="month != null">month = #{month},</if>
|
|
|
|
<if test="day != null">day = #{day},</if>
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
2024-08-31 00:08:49 +08:00
|
|
|
<if test="creator != null">creator = #{creator},</if>
|
2024-08-28 20:54:03 +08:00
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
2024-08-31 00:08:49 +08:00
|
|
|
<if test="updater != null">updater = #{updater},</if>
|
2024-08-28 20:54:03 +08:00
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteInspectionInfoById" parameterType="Long">
|
|
|
|
delete from inspection_info where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteInspectionInfoByIds" parameterType="String">
|
|
|
|
delete from inspection_info where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
<select id="workOrder" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
2024-09-01 21:13:39 +08:00
|
|
|
select ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as realPayMoney
|
2024-08-28 20:54:03 +08:00
|
|
|
,oi.pay_type,oi.order_status as orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,ins.create_time
|
|
|
|
from inspection_info ins
|
|
|
|
left join order_info oi on oi.id = ins.inspection_order_id
|
2024-09-01 21:13:39 +08:00
|
|
|
left join system_users su on su.id = ins.user_id
|
|
|
|
left join system_user_role sur on sur.user_id = su.id
|
2024-09-19 17:57:05 +08:00
|
|
|
where 1=1
|
2024-08-28 20:54:03 +08:00
|
|
|
<if test="carNum!=null and carNum!=''">
|
|
|
|
and ins.car_num like concat('%',#{carNum},'%')
|
|
|
|
</if>
|
|
|
|
<if test="goodsTitle!=null and goodsTitle!=''">
|
|
|
|
and oi.goods_title like concat('%',#{goodsTitle},'%')
|
|
|
|
</if>
|
|
|
|
<if test="roleId!=null and roleId!=''">
|
|
|
|
and sur.role_id = #{roleId}
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="customerSource!=null and customerSource!=''">
|
|
|
|
and ins.customer_source =#{customerSource}
|
|
|
|
</if>
|
|
|
|
<if test="payType!=null and payType!=''">
|
|
|
|
and oi.pay_type = #{payType}
|
|
|
|
</if>
|
|
|
|
<if test="startTime!=null and startTime!=''">
|
|
|
|
and ins.start_time between #{startTime} and #{endTime}
|
|
|
|
</if>
|
|
|
|
order by ins.start_time desc
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="delworkOrder" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
2024-09-01 21:13:39 +08:00
|
|
|
select ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as realPayMoney
|
2024-08-28 20:54:03 +08:00
|
|
|
,oi.pay_type,oi.order_status as orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,ins.create_time
|
|
|
|
from del_inspection_info ins
|
|
|
|
left join del_order_info oi on oi.id = ins.inspection_order_id
|
2024-09-01 21:13:39 +08:00
|
|
|
left join system_users su on su.id = ins.user_id
|
|
|
|
left join system_user_role sur on sur.user_id = su.id
|
2024-09-19 17:57:05 +08:00
|
|
|
where 1=1
|
2024-08-28 20:54:03 +08:00
|
|
|
<if test="carNum!=null and carNum!=''">
|
|
|
|
and ins.car_num like concat('%',#{carNum},'%')
|
|
|
|
</if>
|
|
|
|
<if test="goodsTitle!=null and goodsTitle!=''">
|
|
|
|
and oi.goods_title like concat('%',#{goodsTitle},'%')
|
|
|
|
</if>
|
|
|
|
<if test="roleId!=null and roleId!=''">
|
|
|
|
and sur.role_id = #{roleId}
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="customerSource!=null and customerSource!=''">
|
|
|
|
and ins.customer_source =#{customerSource}
|
|
|
|
</if>
|
|
|
|
<if test="payType!=null and payType!=''">
|
|
|
|
and oi.pay_type = #{payType}
|
|
|
|
</if>
|
|
|
|
<if test="startTime!=null and startTime!=''">
|
|
|
|
and ins.start_time between #{startTime} and #{endTime}
|
|
|
|
</if>
|
|
|
|
order by ins.start_time desc
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="workOrderData" resultType="java.util.Map">
|
|
|
|
select ifnull(sum(oi.pay_money),0) as payMoneySum,ifnull(sum(oi.goods_price),0) goodsPriceSum
|
|
|
|
from inspection_info ins
|
|
|
|
left join order_info oi on oi.id = ins.inspection_order_id
|
2024-09-01 21:13:39 +08:00
|
|
|
left join system_users su on su.id = ins.user_id
|
|
|
|
left join system_user_role sur on sur.user_id = su.id
|
2024-09-19 17:57:05 +08:00
|
|
|
where 1=1
|
2024-08-28 20:54:03 +08:00
|
|
|
<if test="carNum!=null and carNum!=''">
|
|
|
|
and ins.car_num like concat('%',#{carNum},'%')
|
|
|
|
</if>
|
|
|
|
<if test="goodsTitle!=null and goodsTitle!=''">
|
|
|
|
and oi.goods_title like concat('%',#{goodsTitle},'%')
|
|
|
|
</if>
|
|
|
|
<if test="roleId!=null and roleId!=''">
|
|
|
|
and sur.role_id = #{roleId}
|
|
|
|
</if>
|
|
|
|
|
|
|
|
<if test="customerSource!=null and customerSource!=''">
|
|
|
|
and ins.customer_source =#{customerSource}
|
|
|
|
</if>
|
|
|
|
<if test="payType!=null and payType!=''">
|
|
|
|
and oi.pay_type = #{payType}
|
|
|
|
</if>
|
|
|
|
<if test="startTime!=null and startTime!=''">
|
|
|
|
and ins.start_time between #{startTime} and #{endTime}
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
</mapper>
|