<?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.gy.sales.mapper.ParameterItemsMapper">
<resultMap type="ParaConfigItems" id="parameterItemsViewResultMap">
<id column="SAL_CFG_ID" property="cfgId" />
<result column="SAL_CFG_GROUP_CODE_ID" property="groupId" />
<result column="CFGKEY" property="cfgKey" />
<result column="CFGVALUE" property="cfgValue" />
<result column="CFGSTATUS" property="cfgStatus" />
<result column="CFGLEVEL" property="cfgLevel" />
<result column="SORT" property="sortNo" />
<result column="REMARK" property="remark" />
</resultMap>
<select id="getQueryCounts" resultMap="parameterItemsViewResultMap">
SELECT
SAL_CFG_ID ,
SAL_CFG_GROUP_CODE_ID,
CFGKEY,
CFGVALUE,
CFGSTATUS,
CFGLEVEL,
SORT,
REMARK
FROM `sales`.`T_SAL_PARA_CONFIG_ITEMS`
WHERE 1 = 1
<if test="paraNo != null and paraNo != ''">
AND SAL_CFG_ID = #{paraNo}
</if>
<if test="paraName != null and paraName != ''">
and CFGKEY like concat('%', #{paraName}, '%')
</if>
</select>
<select id="getPageList" resultMap="parameterItemsViewResultMap">
SELECT
SAL_CFG_ID ,
SAL_CFG_GROUP_CODE_ID,
CFGKEY,
CFGVALUE,
IF(g.CFGSTATUS='0', '启用', '禁用') as CFGSTATUS,
CASE CFGLEVEL WHEN 0 THEN '不可见' WHEN 1 THEN '只读' ELSE '读和改' END as CFGLEVEL,
SORT,
REMARK
FROM T_SAL_PARA_CONFIG_ITEMS g
WHERE 1 = 1
<if test="paraNo != null and paraNo != ''">
AND SAL_CFG_ID =#{paraNo}
</if>
<if test="paraName != null and paraName != ''">
and CFGKEY like concat('%', #{paraName}, '%')
</if>
<if test="firstRow != null and rowSize != null">
<![CDATA[ limit #{firstRow},#{rowSize} ]]>
</if>
</select>
<insert id="addParaItem" useGeneratedKeys="true" parameterType="ParaConfigItems">
INSERT INTO T_SAL_PARA_CONFIG_ITEMS
(SAL_CFG_GROUP_CODE_ID,
CFGKEY,
CFGVALUE,
CFGSTATUS,
CFGLEVEL,
SORT,
REMARK
)
VALUES
(
#{cfg.groupId},
#{cfg.cfgKey},
#{cfg.cfgValue},
#{cfg.cfgStatus},
#{cfg.cfgLevel},
#{cfg.sortNo},
#{cfg.remark}
)
</insert>
<update id="updateParaItem" parameterType="ParaConfigItems">
UPDATE
T_SAL_PARA_CONFIG_ITEMS
SET
SAL_CFG_GROUP_CODE_ID = #{cfg.groupId},
CFGKEY = #{cfg.cfgKey},
CFGVALUE = #{cfg.cfgValue},
CFGSTATUS =
#{cfg.cfgStatus},
CFGLEVEL = #{cfg.cfgLevel},
SORT = #{cfg.sortNo},
REMARK = #{cfg.remark}
WHERE SAL_CFG_ID = #{cfg.cfgId}
</update>
<delete id="delParaItem" parameterType="java.lang.String"
flushCache="true">
delete from T_SAL_PARA_CONFIG_ITEMS
where SAL_CFG_ID =
#{id}
</delete>
</mapper>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gy.sales.mapper.ParameterItemsMapper">
<resultMap type="ParaConfigItems" id="parameterItemsViewResultMap">
<id column="SAL_CFG_ID" property="cfgId" />
<result column="SAL_CFG_GROUP_CODE_ID" property="groupId" />
<result column="CFGKEY" property="cfgKey" />
<result column="CFGVALUE" property="cfgValue" />
<result column="CFGSTATUS" property="cfgStatus" />
<result column="CFGLEVEL" property="cfgLevel" />
<result column="SORT" property="sortNo" />
<result column="REMARK" property="remark" />
</resultMap>
<select id="getQueryCounts" resultMap="parameterItemsViewResultMap">
SELECT
SAL_CFG_ID ,
SAL_CFG_GROUP_CODE_ID,
CFGKEY,
CFGVALUE,
CFGSTATUS,
CFGLEVEL,
SORT,
REMARK
FROM `sales`.`T_SAL_PARA_CONFIG_ITEMS`
WHERE 1 = 1
<if test="paraNo != null and paraNo != ''">
AND SAL_CFG_ID = #{paraNo}
</if>
<if test="paraName != null and paraName != ''">
and CFGKEY like concat('%', #{paraName}, '%')
</if>
</select>
<select id="getPageList" resultMap="parameterItemsViewResultMap">
SELECT
SAL_CFG_ID ,
SAL_CFG_GROUP_CODE_ID,
CFGKEY,
CFGVALUE,
IF(g.CFGSTATUS='0', '启用', '禁用') as CFGSTATUS,
CASE CFGLEVEL WHEN 0 THEN '不可见' WHEN 1 THEN '只读' ELSE '读和改' END as CFGLEVEL,
SORT,
REMARK
FROM T_SAL_PARA_CONFIG_ITEMS g
WHERE 1 = 1
<if test="paraNo != null and paraNo != ''">
AND SAL_CFG_ID =#{paraNo}
</if>
<if test="paraName != null and paraName != ''">
and CFGKEY like concat('%', #{paraName}, '%')
</if>
<if test="firstRow != null and rowSize != null">
<![CDATA[ limit #{firstRow},#{rowSize} ]]>
</if>
</select>
<insert id="addParaItem" useGeneratedKeys="true" parameterType="ParaConfigItems">
INSERT INTO T_SAL_PARA_CONFIG_ITEMS
(SAL_CFG_GROUP_CODE_ID,
CFGKEY,
CFGVALUE,
CFGSTATUS,
CFGLEVEL,
SORT,
REMARK
)
VALUES
(
#{cfg.groupId},
#{cfg.cfgKey},
#{cfg.cfgValue},
#{cfg.cfgStatus},
#{cfg.cfgLevel},
#{cfg.sortNo},
#{cfg.remark}
)
</insert>
<update id="updateParaItem" parameterType="ParaConfigItems">
UPDATE
T_SAL_PARA_CONFIG_ITEMS
SET
SAL_CFG_GROUP_CODE_ID = #{cfg.groupId},
CFGKEY = #{cfg.cfgKey},
CFGVALUE = #{cfg.cfgValue},
CFGSTATUS =
#{cfg.cfgStatus},
CFGLEVEL = #{cfg.cfgLevel},
SORT = #{cfg.sortNo},
REMARK = #{cfg.remark}
WHERE SAL_CFG_ID = #{cfg.cfgId}
</update>
<delete id="delParaItem" parameterType="java.lang.String"
flushCache="true">
delete from T_SAL_PARA_CONFIG_ITEMS
where SAL_CFG_ID =
#{id}
</delete>
</mapper>